Hi Tony,
The values defined in <fcntl.h> are different in
different implementations.
Here's the ones from the BSD version (which probably
match Linux):
/* command values */
#define F_DUPFD 0 /* duplicate file descriptor */
#define F_GETFD 1 /* get file descriptor flags */
#define F_SETFD 2 /* set file descriptor flags */
#define F_GETFL 3 /* get file status flags */
#define F_SETFL 4 /* set file status flags */
#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
#define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */
#define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */
#endif
#define F_OGETLK 7 /* get record locking information */
#define F_OSETLK 8 /* set record locking information */
#define F_OSETLKW 9 /* F_SETLK; wait if blocked */
#define F_DUP2FD 10 /* duplicate file descriptor to arg */
#define F_GETLK 11 /* get record locking information */
#define F_SETLK 12 /* set record locking information */
#define F_SETLKW 13 /* F_SETLK; wait if blocked */
#define F_SETLK_REMOTE 14 /* debugging support for remote locks */
#define F_READAHEAD 15 /* read ahead */
#define F_RDAHEAD 16 /* Darwin compatible read ahead */
and - here's the versions from IBM's z/OS implementation:
/*
* cmd values for fcntl()
*/
#define F_DUPFD 0
#define F_GETFD 1
#define F_SETFD 2
#ifdef __XPG4
#define F_GETFL 259
#else
#define F_GETFL 3
#endif
#define F_SETFL 4
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
#define F_DUPFD2 8
#define F_CLOSFD 9
#define _F_GETFL 3
#if (defined(__UU) || defined(_OE_SOCKETS))
#define F_GETOWN 10
#define F_SETOWN 11
#endif /* __UU || _OE_SOCKETS */
#ifdef __FX
#define F_SETTAG 12
#define F_CONTROL_CVT 13
#endif /* __FX */
/*
* l_type values for record locking with fcntl()
*/
#define F_RDLCK 1
#define F_WRLCK 2
#define F_UNLCK 3
Which numbers would be "right" to use???? I dunno...
In the Dignus implementation, we use the BSD numbers, and
map those to the IBM numbers under-the-covers when we invoke
the IBM interfaces...
- Dave Rivers -
--
[email protected] Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com