diff --git a/newlib/libc/include/devctl.h b/newlib/libc/include/devctl.h index f6055fb96..fd3409f89 100644 --- a/newlib/libc/include/devctl.h +++ b/newlib/libc/include/devctl.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 2016 Joel Sherrill . All rights reserved. + * Copyright (c) 2016,2019 Joel Sherrill . + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +27,28 @@ #ifndef _POSIX_DEVCTL_h_ #define _POSIX_DEVCTL_h_ +/* + * Nothing in this file should be visible unless _POSIX_26_C_SOURCE is + * defined. + */ +#ifdef _POSIX_26_C_SOURCE + +#include + +#if defined(__rtems__) +/* + * The FACE Technical Standard, Edition 3.0 and later require the + * definition of the subcommand SOCKCLOSE in . + * + * Reference: https://www.opengroup.org/face + * + * Using 'D' should avoid the letters used by other users of + */ +#include + +#define SOCKCLOSE _IO('D', 1) /* socket close */ +#endif + /* * The posix_devctl() method is defined by POSIX 1003.26-2003. Aside * from the single method, it adds the following requirements: @@ -35,10 +58,6 @@ * + application must define _POSIX_26_C_SOURCE to use posix_devctl(). * + posix_devctl() is prototyped in */ - -#ifdef _POSIX_26_C_SOURCE -#include - int posix_devctl( int fd, int dcmd,