Implement a stub for fcntl().

This stub does nothing for F_GETFD and F_SETFD, and fails for all other
commands.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
Johannes Sixt
2007-11-13 16:57:47 +01:00
parent 3e0ba4ccdc
commit cf1fd675d2

View File

@@ -563,6 +563,13 @@ int sigaction(int sig, struct sigaction *in, struct sigaction *out);
sig_handler_t mingw_signal(int sig, sig_handler_t handler);
#define signal mingw_signal
#define F_GETFD 1
#define F_SETFD 2
#define FD_CLOEXEC 0x1
static inline int mingw_fcntl(int fd, int cmd, long arg)
{ return cmd == F_GETFD || cmd == F_SETFD ? 0 : (errno = EINVAL, -1); }
#define fcntl mingw_fcntl
#endif /* __MINGW32__ */
#endif