mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-01 12:03:41 +00:00
2ec413b5a9
poll() and select() now delegate to ppoll() and pselect() for assurances that both polyfill implementations are correct and well-tested. Poll now polyfills XNU and BSD quirks re: the hanndling of POLLNVAL and the other similar status flags. This change resolves a misunderstanding concerning how select(exceptfds) is intended to map to POLPRI. We now use E2BIG for bouncing requests that exceed the 64 handle limit on Windows. With pipes and consoles on Windows our poll impl will now report POLLHUP correctly. Issues with Windows path generation have been fixed. For example, it was problematic on Windows to say: posix_spawn_file_actions_addchdir_np("/") due to the need to un-UNC paths in some additional places. Calling fstat on UNC style volume path handles will now work. posix_spawn now supports simulating the opening of /dev/null and other special paths on Windows. Cosmopolitan no longer defines epoll(). I think wepoll is a nice project for using epoll() on Windows socket handles. However we need generalized file descriptor support to make epoll() for Windows work well enough for inclusion in a C library. It's also not worth having epoll() if we can't get it to work on XNU and BSD OSes which provide different abstractions. Even epoll() on Linux isn't that great of an abstraction since it's full of footguns. Last time I tried to get it to be useful I had little luck. Considering how long it took to get poll() and select() to be consistent across platforms, we really have no business claiming to have epoll too. While it'd be nice to have fully implemented, the only software that use epoll() are event i/o libraries used by things like nodejs. Event i/o is not the best paradigm for handling i/o; threads make so much more sense.
42 lines
1.6 KiB
C
42 lines
1.6 KiB
C
#ifndef COSMOPOLITAN_LIBC_CALLS_SYSCALL_NT_INTERNAL_H_
|
|
#define COSMOPOLITAN_LIBC_CALLS_SYSCALL_NT_INTERNAL_H_
|
|
COSMOPOLITAN_C_START_
|
|
|
|
bool32 sys_isatty(int);
|
|
int sys_chdir_nt(const char *);
|
|
int sys_dup_nt(int, int, int, int);
|
|
int sys_execve_nt(const char *, char *const[], char *const[]);
|
|
int sys_faccessat_nt(int, const char *, int, uint32_t);
|
|
int sys_fadvise_nt(int, uint64_t, uint64_t, int);
|
|
int sys_fchdir_nt(int);
|
|
int sys_fchmod_nt(int, uint32_t);
|
|
int sys_fchmodat_nt(int, const char *, uint32_t, int);
|
|
int sys_fcntl_nt(int, int, uintptr_t);
|
|
int sys_fdatasync_nt(int, bool);
|
|
int sys_flock_nt(int, int);
|
|
int sys_fork_nt(uint32_t);
|
|
int sys_fsync_fake(int);
|
|
int sys_ftruncate_nt(int64_t, uint64_t);
|
|
int sys_getloadavg_nt(double *, int);
|
|
int sys_getppid_nt(void);
|
|
int sys_getpriority_nt(int, unsigned);
|
|
int sys_kill_nt(int, int);
|
|
int sys_linkat_nt(int, const char *, int, const char *);
|
|
int sys_madvise_nt(void *, size_t, int);
|
|
int sys_mkdirat_nt(int, const char *, uint32_t);
|
|
int sys_msync_nt(char *, size_t, int);
|
|
int sys_open_nt(int, const char *, uint32_t, int32_t) __wur;
|
|
int sys_pipe_nt(int[hasatleast 2], unsigned);
|
|
int sys_renameat_nt(int, const char *, int, const char *);
|
|
int sys_sched_yield_nt(void);
|
|
int sys_setpriority_nt(int, unsigned, int);
|
|
int sys_symlinkat_nt(const char *, int, const char *);
|
|
int sys_sync_nt(void);
|
|
int sys_truncate_nt(const char *, uint64_t);
|
|
int sys_unlinkat_nt(int, const char *, int);
|
|
int64_t sys_lseek_nt(int, int64_t, int);
|
|
ssize_t sys_read_nt_impl(int, void *, size_t, int64_t);
|
|
ssize_t sys_readlinkat_nt(int, const char *, char *, size_t);
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* COSMOPOLITAN_LIBC_CALLS_SYSCALL_NT_INTERNAL_H_ */
|