mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Add sys_ prefix to unwrapped system calls
This change also implements getlogin() and getlogin_r().
This commit is contained in:
parent
8f5678882d
commit
aab4ee4072
811 changed files with 1112 additions and 1796 deletions
|
@ -206,6 +206,8 @@ _close_fds_by_brute_force(long start_fd, PyObject *py_fds_to_keep)
|
|||
}
|
||||
}
|
||||
|
||||
int sys_getdents(unsigned, void *, unsigned, long *);
|
||||
|
||||
/* Close all open file descriptors in the range from start_fd and higher
|
||||
* Do not close any in the sorted py_fds_to_keep list.
|
||||
*
|
||||
|
@ -228,7 +230,7 @@ _close_open_fds_safe(int start_fd, PyObject* py_fds_to_keep)
|
|||
struct dirent *entry;
|
||||
int fd, dir, bytes, offset;
|
||||
if ((dir = _Py_open_noraise(FD_DIR, O_RDONLY|O_DIRECTORY)) != -1) {
|
||||
while ((bytes = getdents(dir, buffer, sizeof(buffer), 0)) > 0) {
|
||||
while ((bytes = sys_getdents(dir, buffer, sizeof(buffer), 0)) > 0) {
|
||||
for (offset = 0; offset < bytes; offset += entry->d_reclen) {
|
||||
entry = (struct dirent *)(buffer + offset);
|
||||
if ((fd = _pos_int_from_ascii(entry->d_name)) < 0)
|
||||
|
|
16
third_party/python/pyconfig.h
vendored
16
third_party/python/pyconfig.h
vendored
|
@ -229,9 +229,9 @@
|
|||
/* Define to 1 if you have the 'lockf' function and the F_LOCK macro. */
|
||||
/* #undef HAVE_LOCKF */
|
||||
|
||||
#define HAVE_DEVICE_MACROS 1
|
||||
#define HAVE_MAKEDEV 1
|
||||
#define HAVE_MKDIRAT 1
|
||||
/* #define HAVE_DEVICE_MACROS 1 */
|
||||
#define HAVE_MAKEDEV 1
|
||||
#define HAVE_MKDIRAT 1
|
||||
|
||||
#define HAVE_MBRTOWC 1
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
@ -241,6 +241,11 @@
|
|||
/* #undef HAVE_SEM_OPEN */
|
||||
/* #undef HAVE_SEM_TIMEDWAIT */
|
||||
/* #undef HAVE_SEM_UNLINK */
|
||||
/* #define HAVE_MKNOD 1 */
|
||||
/* #define HAVE_MKNODAT 1 */
|
||||
/* #define HAVE_MKFIFO 1 */
|
||||
/* #define HAVE_MKFIFOAT 1 */
|
||||
/* #define HAVE_SETHOSTNAME 1 */
|
||||
|
||||
#define HAVE_DIRENT_H 1
|
||||
#define HAVE_GETPPID 1
|
||||
|
@ -248,10 +253,6 @@
|
|||
#define HAVE_LINKAT 1
|
||||
#define HAVE_LSTAT 1
|
||||
#define HAVE_LUTIMES 1
|
||||
#define HAVE_MKFIFO 1
|
||||
#define HAVE_MKFIFOAT 1
|
||||
#define HAVE_MKNOD 1
|
||||
#define HAVE_MKNODAT 1
|
||||
#define HAVE_MKTIME 1
|
||||
#define HAVE_MMAP 1
|
||||
#define HAVE_NICE 1
|
||||
|
@ -275,7 +276,6 @@
|
|||
#define HAVE_SETEGID 1
|
||||
#define HAVE_SETEUID 1
|
||||
#define HAVE_SETGID 1
|
||||
#define HAVE_SETHOSTNAME 1
|
||||
#define HAVE_SETITIMER 1
|
||||
#define HAVE_SETLOCALE 1
|
||||
#define HAVE_SETPGID 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue