mirror of
https://git.musl-libc.org/git/musl
synced 2025-02-19 19:54:16 +03:00
cleanup src/linux and src/misc trees, etc.
previously, it was pretty much random which one of these trees a given function appeared in. they have now been organized into: src/linux: non-POSIX linux syscalls (possibly shard with other nixen) src/legacy: various obsolete/legacy functions, mostly wrappers src/misc: still mostly uncategorized; some misc POSIX, some nonstd src/crypt: crypt hash functions further cleanup will be done later.
This commit is contained in:
parent
780aede419
commit
b9bb8f67bb
27
src/linux/epoll.c
Normal file
27
src/linux/epoll.c
Normal file
@ -0,0 +1,27 @@
|
||||
#include <sys/epoll.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int epoll_create(int size)
|
||||
{
|
||||
return syscall(SYS_epoll_create, size);
|
||||
}
|
||||
|
||||
int epoll_create1(int flags)
|
||||
{
|
||||
return syscall(SYS_epoll_create1, flags);
|
||||
}
|
||||
|
||||
int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
|
||||
{
|
||||
return syscall(SYS_epoll_ctl, fd, op, fd2, ev);
|
||||
}
|
||||
|
||||
int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
|
||||
{
|
||||
return syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, __SYSCALL_SSLEN);
|
||||
}
|
||||
|
||||
int epoll_wait(int fd, struct epoll_event *ev, int cnt, int to)
|
||||
{
|
||||
return syscall(SYS_epoll_wait, fd, ev, cnt, to);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/epoll.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int epoll_create(int size)
|
||||
{
|
||||
return syscall(SYS_epoll_create, size);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/epoll.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int epoll_create1(int flags)
|
||||
{
|
||||
return syscall(SYS_epoll_create1, flags);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/epoll.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev)
|
||||
{
|
||||
return syscall(SYS_epoll_ctl, fd, op, fd2, ev);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/epoll.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs)
|
||||
{
|
||||
return syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, __SYSCALL_SSLEN);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/epoll.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int epoll_wait(int fd, struct epoll_event *ev, int cnt, int to)
|
||||
{
|
||||
return syscall(SYS_epoll_wait, fd, ev, cnt, to);
|
||||
}
|
@ -1,7 +1,18 @@
|
||||
#include <sys/eventfd.h>
|
||||
#include <unistd.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int eventfd(unsigned int count, int flags)
|
||||
{
|
||||
return syscall(flags ? SYS_eventfd2 : SYS_eventfd, count, flags);
|
||||
}
|
||||
|
||||
int eventfd_read(int fd, eventfd_t *value)
|
||||
{
|
||||
return (sizeof(*value) == read(fd, value, sizeof(*value))) ? 0 : -1;
|
||||
}
|
||||
|
||||
int eventfd_write(int fd, eventfd_t value)
|
||||
{
|
||||
return (sizeof(value) == write(fd, &value, sizeof(value))) ? 0 : -1;
|
||||
}
|
||||
|
@ -1,7 +0,0 @@
|
||||
#include <sys/eventfd.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int eventfd_read(int fd, eventfd_t *value)
|
||||
{
|
||||
return (sizeof(*value) == read(fd, value, sizeof(*value))) ? 0 : -1;
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/eventfd.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int eventfd_write(int fd, eventfd_t value)
|
||||
{
|
||||
return (sizeof(value) == write(fd, &value, sizeof(value))) ? 0 : -1;
|
||||
}
|
21
src/linux/inotify.c
Normal file
21
src/linux/inotify.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <sys/inotify.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int inotify_init()
|
||||
{
|
||||
return syscall(SYS_inotify_init);
|
||||
}
|
||||
int inotify_init1(int flags)
|
||||
{
|
||||
return syscall(SYS_inotify_init1, flags);
|
||||
}
|
||||
|
||||
int inotify_add_watch(int fd, const char *pathname, uint32_t mask)
|
||||
{
|
||||
return syscall(SYS_inotify_add_watch, fd, pathname, mask);
|
||||
}
|
||||
|
||||
int inotify_rm_watch(int fd, uint32_t wd)
|
||||
{
|
||||
return syscall(SYS_inotify_rm_watch, fd, wd);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/inotify.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int inotify_add_watch(int fd, const char *pathname, uint32_t mask)
|
||||
{
|
||||
return syscall(SYS_inotify_add_watch, fd, pathname, mask);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/inotify.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int inotify_init()
|
||||
{
|
||||
return syscall(SYS_inotify_init);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/inotify.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int inotify_init1(int flags)
|
||||
{
|
||||
return syscall(SYS_inotify_init1, flags);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/inotify.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int inotify_rm_watch(int fd, uint32_t wd)
|
||||
{
|
||||
return syscall(SYS_inotify_rm_watch, fd, wd);
|
||||
}
|
@ -5,3 +5,13 @@ int mount(const char *special, const char *dir, const char *fstype, unsigned lon
|
||||
{
|
||||
return syscall(SYS_mount, special, dir, fstype, flags, data);
|
||||
}
|
||||
|
||||
int umount(const char *special)
|
||||
{
|
||||
return syscall(SYS_umount2, special, 0);
|
||||
}
|
||||
|
||||
int umount2(const char *special, int flags)
|
||||
{
|
||||
return syscall(SYS_umount2, special, flags);
|
||||
}
|
||||
|
@ -5,3 +5,8 @@ int swapon(const char *path, int flags)
|
||||
{
|
||||
return syscall(SYS_swapon, path, flags);
|
||||
}
|
||||
|
||||
int swapoff(const char *path)
|
||||
{
|
||||
return syscall(SYS_swapoff, path);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/swap.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int swapoff(const char *path)
|
||||
{
|
||||
return syscall(SYS_swapoff, path);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/mount.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int umount(const char *special)
|
||||
{
|
||||
return syscall(SYS_umount2, special, 0);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#include <sys/mount.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int umount2(const char *special, int flags)
|
||||
{
|
||||
return syscall(SYS_umount2, special, flags);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user