feat: ports - git port

This commit is contained in:
2026-08-09 10:47:07 +02:00
parent cfb8d91442
commit 6f3cf99667
34 changed files with 2255 additions and 2 deletions
+37
View File
@@ -0,0 +1,37 @@
/*
* <poll.h> for the MontaukOS git port.
*
* git polls only descriptors it created itself with pipe() -- the stdout and
* stderr of a spawned sub-process (run-command.c's pump loop, sideband
* demultiplexing). MontaukOS has neither pipe() nor fork(), so those code
* paths are unreachable at runtime; this header exists so they compile, and
* the implementation reports every descriptor ready so that a caller which
* somehow gets here makes progress into the read() that reports the real
* error, instead of spinning in the poll loop forever.
*
* git's own compat/poll (NO_POLL=1) is not used: it is written against
* select() and <sys/select.h>, neither of which exists here.
*
* Implementation in montauk-compat.c.
*/
#ifndef _MONTAUK_GIT_POLL_H_
#define _MONTAUK_GIT_POLL_H_
typedef unsigned long nfds_t;
struct pollfd {
int fd;
short events;
short revents;
};
#define POLLIN 0x001
#define POLLPRI 0x002
#define POLLOUT 0x004
#define POLLERR 0x008
#define POLLHUP 0x010
#define POLLNVAL 0x020
int poll(struct pollfd *fds, nfds_t nfds, int timeout);
#endif /* _MONTAUK_GIT_POLL_H_ */