close.c 270 字节
Newer Older
R
Rich Felker 已提交
1
#include <unistd.h>
2
#include <errno.h>
R
Rich Felker 已提交
3 4
#include "syscall.h"

5 6 7 8 9 10 11
static int dummy(int fd)
{
	return fd;
}

weak_alias(dummy, __aio_close);

R
Rich Felker 已提交
12 13
int close(int fd)
{
14
	fd = __aio_close(fd);
15
	int r = __syscall_cp(SYS_close, fd);
16
	if (r == -EINTR) r = 0;
17
	return __syscall_ret(r);
R
Rich Felker 已提交
18
}