| 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_SYSUNISTD_H_ |
| 19 |
#define _MACPORTS_SYSUNISTD_H_ |
| 20 |
|
| 21 |
/* MP support header */ |
| 22 |
#include "MacportsLegacySupport.h" |
| 23 |
|
| 24 |
/* Include the primary system unistd.h */ |
| 25 |
#include_next <sys/unistd.h> |
| 26 |
|
| 27 |
/* For types such as uint32_t. */ |
| 28 |
#include <stdint.h> |
| 29 |
|
| 30 |
#if __MP_LEGACY_SUPPORT_ATCALLS__ |
| 31 |
|
| 32 |
/* |
| 33 |
* [XSI] The ssize_t and size_t types shall be defined as described |
| 34 |
* in <sys/types.h>. |
| 35 |
*/ |
| 36 |
#ifndef _SIZE_T |
| 37 |
#define _SIZE_T |
| 38 |
typedef __darwin_size_t size_t; |
| 39 |
#endif |
| 40 |
|
| 41 |
#ifndef _SSIZE_T |
| 42 |
#define _SSIZE_T |
| 43 |
typedef __darwin_ssize_t ssize_t; |
| 44 |
#endif |
| 45 |
|
| 46 |
#ifndef _UID_T |
| 47 |
#define _UID_T |
| 48 |
typedef __darwin_uid_t uid_t; /* user id */ |
| 49 |
#endif |
| 50 |
|
| 51 |
#ifndef _GID_T |
| 52 |
#define _GID_T |
| 53 |
typedef __darwin_gid_t gid_t; |
| 54 |
#endif |
| 55 |
|
| 56 |
__MP__BEGIN_DECLS |
| 57 |
|
| 58 |
extern int getattrlistat(int dirfd, const char *pathname, void *a, |
| 59 |
void *buf, size_t size, unsigned long flags); |
| 60 |
extern ssize_t readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz); |
| 61 |
extern int faccessat(int dirfd, const char *pathname, int mode, int flags); |
| 62 |
extern int fchownat(int dirfd, const char *pathname, uid_t owner, gid_t group, int flags); |
| 63 |
extern int linkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags); |
| 64 |
extern int symlinkat(const char *oldpath, int newdirfd, const char *newpath); |
| 65 |
extern int unlinkat(int dirfd, const char *pathname, int flags); |
| 66 |
|
| 67 |
__MP__END_DECLS |
| 68 |
|
| 69 |
#endif /* __MP_LEGACY_SUPPORT_ATCALLS__ */ |
| 70 |
|
| 71 |
|
| 72 |
#if __MP_LEGACY_SUPPORT_SETATTRLISTAT__ |
| 73 |
|
| 74 |
/* |
| 75 |
* [XSI] The ssize_t and size_t types shall be defined as described |
| 76 |
* in <sys/types.h>. |
| 77 |
*/ |
| 78 |
#ifndef _SIZE_T |
| 79 |
#define _SIZE_T |
| 80 |
typedef __darwin_size_t size_t; |
| 81 |
#endif |
| 82 |
|
| 83 |
|
| 84 |
__MP__BEGIN_DECLS |
| 85 |
|
| 86 |
extern int setattrlistat(int dirfd, const char *pathname, void *a, |
| 87 |
void *buf, size_t size, uint32_t flags); |
| 88 |
|
| 89 |
__MP__END_DECLS |
| 90 |
|
| 91 |
#endif /* __MP_LEGACY_SUPPORT_SETATTRLISTAT__ */ |
| 92 |
|
| 93 |
#endif /* _MACPORTS_SYSUNISTD_H_ */ |