working on it
This commit is contained in:
parent
56a6e78765
commit
35a88970c2
1094 changed files with 51093 additions and 51 deletions
9
05/musl-final/src/fcntl/creat.c
Normal file
9
05/musl-final/src/fcntl/creat.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include <fcntl.h>
|
||||
#include "libc.h"
|
||||
|
||||
int creat(const char *filename, mode_t mode)
|
||||
{
|
||||
return open(filename, O_CREAT|O_WRONLY|O_TRUNC, mode);
|
||||
}
|
||||
|
||||
LFS64(creat);
|
22
05/musl-final/src/fcntl/fcntl.c
Normal file
22
05/musl-final/src/fcntl/fcntl.c
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include "syscall.h"
|
||||
#include "libc.h"
|
||||
|
||||
int fcntl(int fd, int cmd, ...)
|
||||
{
|
||||
int r;
|
||||
long arg;
|
||||
va_list ap;
|
||||
va_start(ap, cmd);
|
||||
arg = va_arg(ap, long);
|
||||
va_end(ap);
|
||||
if (cmd == F_SETFL) arg |= O_LARGEFILE;
|
||||
if (cmd == F_SETLKW) CANCELPT_BEGIN;
|
||||
r = __syscall_fcntl(fd, cmd, arg);
|
||||
if (cmd == F_SETLKW) CANCELPT_END;
|
||||
return r;
|
||||
}
|
||||
|
||||
LFS64(fcntl);
|
21
05/musl-final/src/fcntl/open.c
Normal file
21
05/musl-final/src/fcntl/open.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include "syscall.h"
|
||||
#include "libc.h"
|
||||
|
||||
int open(const char *filename, int flags, ...)
|
||||
{
|
||||
int r;
|
||||
mode_t mode;
|
||||
va_list ap;
|
||||
va_start(ap, flags);
|
||||
mode = va_arg(ap, mode_t);
|
||||
va_end(ap);
|
||||
CANCELPT_BEGIN;
|
||||
r = __syscall_open(filename, flags, mode);
|
||||
CANCELPT_END;
|
||||
return r;
|
||||
}
|
||||
|
||||
LFS64(open);
|
21
05/musl-final/src/fcntl/openat.c
Normal file
21
05/musl-final/src/fcntl/openat.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
#include "syscall.h"
|
||||
#include "libc.h"
|
||||
|
||||
int openat(int fd, const char *filename, int flags, ...)
|
||||
{
|
||||
int r;
|
||||
mode_t mode;
|
||||
va_list ap;
|
||||
va_start(ap, flags);
|
||||
mode = va_arg(ap, mode_t);
|
||||
va_end(ap);
|
||||
CANCELPT_BEGIN;
|
||||
r = syscall4(__NR_openat, fd, (long)filename, flags|O_LARGEFILE, mode);
|
||||
CANCELPT_END;
|
||||
return r;
|
||||
}
|
||||
|
||||
LFS64(openat);
|
Loading…
Add table
Add a link
Reference in a new issue