diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 526717f85..6ac584ae5 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,11 @@ +2014-01-17 Sebastian Huber + + * libc/include/sys/_default_fcntl.h (LOCK_SH): Define. + (LOCK_EX): Likewise. + (LOCK_NB): Likewise. + (LOCK_UN): Likewise. + (flock): Declare. + 2014-01-17 Corinna Vinschen Introduce _STDIO_BSD_SEMANTICS flag to switch fclose/exit file flushing diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h index 40d8fae17..b70e71e1e 100644 --- a/newlib/libc/include/sys/_default_fcntl.h +++ b/newlib/libc/include/sys/_default_fcntl.h @@ -148,6 +148,14 @@ extern "C" { #define AT_REMOVEDIR 8 #endif +#if __BSD_VISIBLE +/* lock operations for flock(2) */ +#define LOCK_SH 0x01 /* shared file lock */ +#define LOCK_EX 0x02 /* exclusive file lock */ +#define LOCK_NB 0x04 /* don't block when locking */ +#define LOCK_UN 0x08 /* unlock file */ +#endif + /*#include */ #ifndef __CYGWIN__ @@ -176,7 +184,6 @@ struct eflock { }; #endif /* !_POSIX_SOURCE */ - #include #include /* sigh. for the mode bits for open/creat */ @@ -186,6 +193,9 @@ extern int openat _PARAMS ((int, const char *, int, ...)); #endif extern int creat _PARAMS ((const char *, mode_t)); extern int fcntl _PARAMS ((int, int, ...)); +#if __BSD_VISIBLE +extern int flock _PARAMS ((int, int)); +#endif #ifdef __CYGWIN__ #include extern int futimesat _PARAMS ((int, const char *, const struct timeval *));