提交 b9bb8f67 编写于 作者: R Rich Felker

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.
上级 780aede4
#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);
}
#include <sys/epoll.h>
#include "syscall.h"
int epoll_create(int size)
{
return syscall(SYS_epoll_create, size);
}
#include <sys/epoll.h>
#include "syscall.h"
int epoll_create1(int flags)
{
return syscall(SYS_epoll_create1, flags);
}
#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);
}
#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);
}
#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;
}
#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;
}
#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;
}
#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);
}
#include <sys/inotify.h>
#include "syscall.h"
int inotify_init()
{
return syscall(SYS_inotify_init);
}
#include <sys/inotify.h>
#include "syscall.h"
int inotify_init1(int flags)
{
return syscall(SYS_inotify_init1, flags);
}
#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);
}
#include <sys/swap.h>
#include "syscall.h"
int swapoff(const char *path)
{
return syscall(SYS_swapoff, path);
}
#include <sys/mount.h>
#include "syscall.h"
int umount(const char *special)
{
return syscall(SYS_umount2, special, 0);
}
#include <sys/mount.h>
#include "syscall.h"
int umount2(const char *special, int flags)
{
return syscall(SYS_umount2, special, flags);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册