Add dummy guarded_* functions that actually do no guarding

This commit is contained in:
Lubos Dolezel 2017-04-09 12:02:00 +02:00
parent a07f054985
commit fdc3ea4c5a
8 changed files with 69 additions and 0 deletions

View File

@ -25,6 +25,9 @@ set(emulation_sources
errno.c
readline.c
common_at.c
guarded/guarded_open_np.c
guarded/guarded_close_np.c
guarded/guarded_kqueue_np.c
machdep/machdeps.c
machdep/machdep-table.S
machdep/tls.c

View File

@ -0,0 +1,12 @@
#include "guarded_close_np.h"
#include "../base.h"
#include "../errno.h"
#include <linux-syscalls/linux.h>
#include "../unistd/close.h"
long sys_guarded_close_np(int fd, uint64_t* guardid)
{
*guardid = 0;
return sys_close(fd);
}

View File

@ -0,0 +1,8 @@
#ifndef LINUX_GUARDED_CLOSE_H
#define LINUX_GUARDED_CLOSE_H
#include <stdint.h>
long sys_guarded_close_np(int fd, uint64_t* guardid);
#endif

View File

@ -0,0 +1,12 @@
#include "guarded_kqueue_np.h"
#include "../base.h"
#include "../errno.h"
#include <linux-syscalls/linux.h>
#include "../kqueue/kqueue.h"
long sys_guarded_kqueue_np(uint64_t* guardid, unsigned guardflags)
{
*guardid = 0;
return sys_kqueue();
}

View File

@ -0,0 +1,8 @@
#ifndef LINUX_GUARDED_KQUEUE_H
#define LINUX_GUARDED_KQUEUE_H
#include <stdint.h>
long sys_guarded_kqueue_np(uint64_t* guardid, unsigned guardflags);
#endif

View File

@ -0,0 +1,12 @@
#include "guarded_open_np.h"
#include "../base.h"
#include "../errno.h"
#include <linux-syscalls/linux.h>
#include "../fcntl/open.h"
long sys_guarded_open_np(const char* filename, uint64_t* guardid, unsigned int guardflags, int flags, unsigned int mode)
{
*guardid = 0;
return sys_open(filename, flags, mode);
}

View File

@ -0,0 +1,8 @@
#ifndef LINUX_GUARDED_OPEN_H
#define LINUX_GUARDED_OPEN_H
#include <stdint.h>
long sys_guarded_open_np(const char* filename, uint64_t* guardid, unsigned int guardflags, int flags, unsigned int mode);
#endif

View File

@ -4,6 +4,9 @@
#include "kqueue/kevent.h"
#include "unistd/write.h"
#include "unistd/read.h"
#include "guarded/guarded_open_np.h"
#include "guarded/guarded_close_np.h"
#include "guarded/guarded_kqueue_np.h"
#include "mman/mman.h"
#include "mman/madvise.h"
#include "mman/msync.h"
@ -361,6 +364,9 @@ void* __bsd_syscall_table[600] = {
[415] = sys_pwrite_nocancel,
[417] = sys_poll_nocancel,
[423] = sys_semwait_signal_nocancel,
[441] = sys_guarded_open_np,
[442] = sys_guarded_close_np,
[443] = sys_guarded_kqueue_np,
[461] = sys_getattrlistbulk,
[463] = sys_openat,
[464] = sys_openat_nocancel,