diff options
author | julian <julian@FreeBSD.org> | 2007-03-29 02:11:46 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2007-03-29 02:11:46 +0000 |
commit | 93fc8e768e49d2737c73c10e780d085f9fe2de7d (patch) | |
tree | f48ac269cb2bbda7e0d9278c796db1a7d0a2cb59 /sys/i386 | |
parent | fdf75b902074d70bcb83a0421e1e7a1ef8f5bed5 (diff) | |
download | FreeBSD-src-93fc8e768e49d2737c73c10e780d085f9fe2de7d.zip FreeBSD-src-93fc8e768e49d2737c73c10e780d085f9fe2de7d.tar.gz |
Implement the openat() linux syscall
Submitted by: Roman Divacky (rdivacky@)
MFC after: 2 weeks
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/linux/linux.h | 3 | ||||
-rw-r--r-- | sys/i386/linux/linux_dummy.c | 1 | ||||
-rw-r--r-- | sys/i386/linux/linux_proto.h | 7 | ||||
-rw-r--r-- | sys/i386/linux/linux_sysent.c | 2 | ||||
-rw-r--r-- | sys/i386/linux/syscalls.master | 3 |
5 files changed, 11 insertions, 5 deletions
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h index c7219ba..ef41399 100644 --- a/sys/i386/linux/linux.h +++ b/sys/i386/linux/linux.h @@ -502,6 +502,7 @@ int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h); #define LINUX_O_RDONLY 00000000 #define LINUX_O_WRONLY 00000001 #define LINUX_O_RDWR 00000002 +#define LINUX_O_ACCMODE 00000003 #define LINUX_O_CREAT 00000100 #define LINUX_O_EXCL 00000200 #define LINUX_O_NOCTTY 00000400 @@ -536,6 +537,8 @@ int linux_ioctl_unregister_handler(struct linux_ioctl_handler *h); #define LINUX_F_WRLCK 1 #define LINUX_F_UNLCK 2 +#define LINUX_AT_FDCWD -100 + /* * mount flags */ diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy.c index cd2c615..fec4f65 100644 --- a/sys/i386/linux/linux_dummy.c +++ b/sys/i386/linux/linux_dummy.c @@ -87,7 +87,6 @@ DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); DUMMY(migrate_pages); -DUMMY(openat); DUMMY(mkdirat); DUMMY(mknodat); DUMMY(fchownat); diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index f828447..53b0520 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -893,7 +893,10 @@ struct linux_migrate_pages_args { register_t dummy; }; struct linux_openat_args { - register_t dummy; + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(char *)]; char * filename; char filename_r_[PADR_(char *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; }; struct linux_mkdirat_args { register_t dummy; @@ -1407,7 +1410,7 @@ int linux_unshare(struct thread *, struct linux_unshare_args *); #define LINUX_SYS_AUE_linux_inotify_add_watch AUE_NULL #define LINUX_SYS_AUE_linux_inotify_rm_watch AUE_NULL #define LINUX_SYS_AUE_linux_migrate_pages AUE_NULL -#define LINUX_SYS_AUE_linux_openat AUE_NULL +#define LINUX_SYS_AUE_linux_openat AUE_OPEN_RWTC #define LINUX_SYS_AUE_linux_mkdirat AUE_NULL #define LINUX_SYS_AUE_linux_mknodat AUE_NULL #define LINUX_SYS_AUE_linux_fchownat AUE_NULL diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c index b961a25..a38e54a 100644 --- a/sys/i386/linux/linux_sysent.c +++ b/sys/i386/linux/linux_sysent.c @@ -314,7 +314,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)linux_inotify_add_watch, AUE_NULL, NULL, 0, 0 }, /* 292 = linux_inotify_add_watch */ { 0, (sy_call_t *)linux_inotify_rm_watch, AUE_NULL, NULL, 0, 0 }, /* 293 = linux_inotify_rm_watch */ { 0, (sy_call_t *)linux_migrate_pages, AUE_NULL, NULL, 0, 0 }, /* 294 = linux_migrate_pages */ - { 0, (sy_call_t *)linux_openat, AUE_NULL, NULL, 0, 0 }, /* 295 = linux_openat */ + { AS(linux_openat_args), (sy_call_t *)linux_openat, AUE_OPEN_RWTC, NULL, 0, 0 }, /* 295 = linux_openat */ { 0, (sy_call_t *)linux_mkdirat, AUE_NULL, NULL, 0, 0 }, /* 296 = linux_mkdirat */ { 0, (sy_call_t *)linux_mknodat, AUE_NULL, NULL, 0, 0 }, /* 297 = linux_mknodat */ { 0, (sy_call_t *)linux_fchownat, AUE_NULL, NULL, 0, 0 }, /* 298 = linux_fchownat */ diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index fa9d444..43946f2 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -473,7 +473,8 @@ 292 AUE_NULL STD { int linux_inotify_add_watch(void); } 293 AUE_NULL STD { int linux_inotify_rm_watch(void); } 294 AUE_NULL STD { int linux_migrate_pages(void); } -295 AUE_NULL STD { int linux_openat(void); } +295 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, char *filename, \ + l_int flags, l_int mode); } 296 AUE_NULL STD { int linux_mkdirat(void); } 297 AUE_NULL STD { int linux_mknodat(void); } 298 AUE_NULL STD { int linux_fchownat(void); } |