| 1 |
|
| 2 |
/* |
| 3 |
* Copyright (c) 2018 Chris Jones <[email protected]> |
| 4 |
* |
| 5 |
* Permission to use, copy, modify, and distribute this software for any |
| 6 |
* purpose with or without fee is hereby granted, provided that the above |
| 7 |
* copyright notice and this permission notice appear in all copies. |
| 8 |
* |
| 9 |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 10 |
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 11 |
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 12 |
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 13 |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 14 |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 16 |
*/ |
| 17 |
|
| 18 |
#ifndef _MACPORTS_SYSFCNTL_H_ |
| 19 |
#define _MACPORTS_SYSFCNTL_H_ |
| 20 |
|
| 21 |
/* MP support header */ |
| 22 |
#include "MacportsLegacySupport.h" |
| 23 |
|
| 24 |
/* Include the primary system fcntl.h */ |
| 25 |
#include_next <sys/fcntl.h> |
| 26 |
|
| 27 |
/* replace missing O_CLOEXEC definition with 0, which works |
| 28 |
* but does not replace the full function of that flag |
| 29 |
* this is the commonly done fix in MacPorts (see gtk3, for example) |
| 30 |
* FIXME - this could use a proper fix, if possible |
| 31 |
*/ |
| 32 |
|
| 33 |
#ifndef O_CLOEXEC |
| 34 |
#define O_CLOEXEC 0 |
| 35 |
#endif |
| 36 |
|
| 37 |
/* atcalls */ |
| 38 |
#if __MP_LEGACY_SUPPORT_ATCALLS__ |
| 39 |
|
| 40 |
#ifndef AT_FDCWD |
| 41 |
#define AT_FDCWD -2 |
| 42 |
#endif |
| 43 |
#ifndef AT_EACCESS |
| 44 |
#define AT_EACCESS 0x0010 /* Use effective ids in access check */ |
| 45 |
#endif |
| 46 |
#ifndef AT_SYMLINK_NOFOLLOW |
| 47 |
#define AT_SYMLINK_NOFOLLOW 0x0020 /* Act on the symlink itself not the target */ |
| 48 |
#endif |
| 49 |
#ifndef AT_SYMLINK_FOLLOW |
| 50 |
#define AT_SYMLINK_FOLLOW 0x0040 /* Act on target of symlink */ |
| 51 |
#endif |
| 52 |
#ifndef AT_REMOVEDIR |
| 53 |
#define AT_REMOVEDIR 0x0080 /* Path refers to directory */ |
| 54 |
#endif |
| 55 |
|
| 56 |
__MP__BEGIN_DECLS |
| 57 |
|
| 58 |
extern int openat(int dirfd, const char *pathname, int flags, ...); |
| 59 |
|
| 60 |
__MP__END_DECLS |
| 61 |
|
| 62 |
#endif /* __MP_LEGACY_SUPPORT_ATCALLS__ */ |
| 63 |
|
| 64 |
#endif /* _MACPORTS_SYSFCNTL_H_ */ |