10#define ROOT_PASSWORD "1234"
39 write(client, &key,
sizeof(key));
46 char*
id =
sreadfile(
"/net/local/seqpacket");
53 if (
swritefile(
F(
"/net/local/%s/ctl",
id),
"bind root && listen") ==
ERR)
59 printf(
"root: listening for connections...\n");
62 fd_t client =
open(
F(
"/net/local/%s/accept",
id));
#define MAX_PATH
Maximum length of filepaths.
#define errno
Error number variable.
#define EPERM
Operation not permitted.
fd_t open(const char *path)
System call for opening files.
uint64_t close(fd_t fd)
System call for closing files.
#define F(format,...)
Allocates a formatted string on the stack.
uint64_t swritefile(const char *path, const char *string)
Wrapper for writing a null-terminated string directly to a file using a path.
uint64_t read(fd_t fd, void *buffer, uint64_t count)
System call for reading from files.
char * sreadfile(const char *path)
Wrapper for reading an entire file directly into a null-terminated string.
uint64_t share(key_t *key, fd_t fd, clock_t timeout)
System call for sharing a file descriptor with another process.
uint64_t write(fd_t fd, const void *buffer, uint64_t count)
System call for writing to files.
#define NULL
Pointer error value.
#define ERR
Integer error value.
__UINT64_TYPE__ fd_t
A file descriptor.
EFI_PHYSICAL_ADDRESS buffer
uint64_t root_handle_client(fd_t client)
_PUBLIC int printf(const char *_RESTRICT format,...)
_PUBLIC _NORETURN void abort(void)
_PUBLIC void free(void *ptr)
_PUBLIC char * strerror(int errnum)
_PUBLIC int strcmp(const char *s1, const char *s2)