toaruos/libc/unistd/hostname.c
2018-08-02 03:40:43 +09:00

18 lines
428 B
C

#include <unistd.h>
#include <syscall.h>
#include <syscall_nums.h>
#include <errno.h>
DEFN_SYSCALL1(sethostname, SYS_SETHOSTNAME, char *);
DEFN_SYSCALL1(gethostname, SYS_GETHOSTNAME, char *);
int gethostname(char * name, size_t len) {
(void)len; /* TODO */
__sets_errno(syscall_gethostname(name));
}
int sethostname(const char * name, size_t len) {
(void)len; /* TODO */
__sets_errno(syscall_sethostname((char*)name));
}