Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/osf1 pathconf/fpathconf
details: https://anonhg.NetBSD.org/src/rev/ed21f05fc37b
branches: trunk
changeset: 472634:ed21f05fc37b
user: cgd <cgd%NetBSD.org@localhost>
date: Tue May 04 02:12:15 1999 +0000
description:
pathconf/fpathconf
diffstat:
sys/compat/osf1/osf1.h | 15 ++++++++++-
sys/compat/osf1/osf1_cvt.c | 54 ++++++++++++++++++++++++++++++++++++++++-
sys/compat/osf1/osf1_cvt.h | 3 +-
sys/compat/osf1/osf1_descrip.c | 23 ++++++++++++++++-
sys/compat/osf1/osf1_file.c | 27 +++++++++++++++++++-
sys/compat/osf1/syscalls.master | 6 ++--
6 files changed, 120 insertions(+), 8 deletions(-)
diffs (203 lines):
diff -r 3348752df596 -r ed21f05fc37b sys/compat/osf1/osf1.h
--- a/sys/compat/osf1/osf1.h Tue May 04 00:35:37 1999 +0000
+++ b/sys/compat/osf1/osf1.h Tue May 04 02:12:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1.h,v 1.14 1999/05/01 02:57:08 cgd Exp $ */
+/* $NetBSD: osf1.h,v 1.15 1999/05/04 02:12:15 cgd Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@@ -509,6 +509,19 @@
};
+/* unistd.h (user-land header) */
+
+#define OSF1__PC_CHOWN_RESTRICTED 10
+#define OSF1__PC_LINK_MAX 11
+#define OSF1__PC_MAX_CANON 12
+#define OSF1__PC_MAX_INPUT 13
+#define OSF1__PC_NAME_MAX 14
+#define OSF1__PC_NO_TRUNC 15
+#define OSF1__PC_PATH_MAX 16
+#define OSF1__PC_PIPE_BUF 17
+#define OSF1__PC_VDISABLE 18
+
+
/* utsname.h */
#define OSF1__SYS_NMLN 32
diff -r 3348752df596 -r ed21f05fc37b sys/compat/osf1/osf1_cvt.c
--- a/sys/compat/osf1/osf1_cvt.c Tue May 04 00:35:37 1999 +0000
+++ b/sys/compat/osf1/osf1_cvt.c Tue May 04 02:12:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_cvt.c,v 1.2 1999/05/01 04:47:00 cgd Exp $ */
+/* $NetBSD: osf1_cvt.c,v 1.3 1999/05/04 02:12:15 cgd Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@@ -513,3 +513,55 @@
oss->ss_flags = emul_flags_translate(osf1_sigaltstack_flags_rxtab,
bss->ss_flags, NULL);
}
+
+int
+osf1_cvt_pathconf_name_to_native(oname, bnamep)
+ int oname, *bnamep;
+{
+ int error;
+
+ error = 0;
+ switch (oname) {
+ case OSF1__PC_CHOWN_RESTRICTED:
+ *bnamep = _PC_CHOWN_RESTRICTED;
+ break;
+
+ case OSF1__PC_LINK_MAX:
+ *bnamep = _PC_LINK_MAX;
+ break;
+
+ case OSF1__PC_MAX_CANON:
+ *bnamep = _PC_MAX_CANON;
+ break;
+
+ case OSF1__PC_MAX_INPUT:
+ *bnamep = _PC_MAX_INPUT;
+ break;
+
+ case OSF1__PC_NAME_MAX:
+ *bnamep = _PC_NAME_MAX;
+ break;
+
+ case OSF1__PC_NO_TRUNC:
+ *bnamep = _PC_NO_TRUNC;
+ break;
+
+ case OSF1__PC_PATH_MAX:
+ *bnamep = _PC_PATH_MAX;
+ break;
+
+ case OSF1__PC_PIPE_BUF:
+ *bnamep = _PC_PIPE_BUF;
+ break;
+
+ case OSF1__PC_VDISABLE:
+ *bnamep = _PC_VDISABLE;
+ break;
+
+ default:
+ error = EINVAL;
+ break;
+ }
+
+ return (error);
+}
diff -r 3348752df596 -r ed21f05fc37b sys/compat/osf1/osf1_cvt.h
--- a/sys/compat/osf1/osf1_cvt.h Tue May 04 00:35:37 1999 +0000
+++ b/sys/compat/osf1/osf1_cvt.h Tue May 04 02:12:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_cvt.h,v 1.3 1999/05/01 04:47:00 cgd Exp $ */
+/* $NetBSD: osf1_cvt.h,v 1.4 1999/05/04 02:12:15 cgd Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@@ -47,6 +47,7 @@
#define osf1_cvt_dev_to_native(dev) \
makedev(osf1_major(dev), osf1_minor(dev))
+int osf1_cvt_pathconf_name_to_native(int oname, int *bnamep);
void osf1_cvt_rusage_from_native(const struct rusage *nru,
struct osf1_rusage *oru);
void osf1_cvt_sigaction_from_native(const struct sigaction *nsa,
diff -r 3348752df596 -r ed21f05fc37b sys/compat/osf1/osf1_descrip.c
--- a/sys/compat/osf1/osf1_descrip.c Tue May 04 00:35:37 1999 +0000
+++ b/sys/compat/osf1/osf1_descrip.c Tue May 04 02:12:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_descrip.c,v 1.1 1999/05/01 05:34:59 cgd Exp $ */
+/* $NetBSD: osf1_descrip.c,v 1.2 1999/05/04 02:12:15 cgd Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@@ -246,3 +246,24 @@
return sys_ftruncate(p, &a, retval);
}
+
+int
+osf1_sys_fpathconf(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct osf1_sys_fpathconf_args *uap = v;
+ struct sys_fpathconf_args a;
+ int error;
+
+ SCARG(&a, fd) = SCARG(uap, fd);
+
+ error = osf1_cvt_pathconf_name_to_native(SCARG(uap, name),
+ &SCARG(&a, name));
+
+ if (error == 0)
+ error = sys_fpathconf(p, &a, retval);
+
+ return (error);
+}
diff -r 3348752df596 -r ed21f05fc37b sys/compat/osf1/osf1_file.c
--- a/sys/compat/osf1/osf1_file.c Tue May 04 00:35:37 1999 +0000
+++ b/sys/compat/osf1/osf1_file.c Tue May 04 02:12:15 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_file.c,v 1.2 1999/05/01 05:33:36 cgd Exp $ */
+/* $NetBSD: osf1_file.c,v 1.3 1999/05/04 02:12:15 cgd Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@@ -322,3 +322,28 @@
return (error);
}
+
+int
+osf1_sys_pathconf(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct osf1_sys_pathconf_args *uap = v;
+ struct sys_pathconf_args a;
+ caddr_t sg;
+ int error;
+
+ sg = stackgap_init(p->p_emul);
+
+ OSF1_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ SCARG(&a, path) = SCARG(uap, path);
+
+ error = osf1_cvt_pathconf_name_to_native(SCARG(uap, name),
+ &SCARG(&a, name));
+
+ if (error == 0)
+ error = sys_pathconf(p, &a, retval);
+
+ return (error);
+}
diff -r 3348752df596 -r ed21f05fc37b sys/compat/osf1/syscalls.master
--- a/sys/compat/osf1/syscalls.master Tue May 04 00:35:37 1999 +0000
+++ b/sys/compat/osf1/syscalls.master Tue May 04 02:12:15 1999 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.23 1999/04/30 04:33:51 cgd Exp $
+ $NetBSD: syscalls.master,v 1.24 1999/05/04 02:12:15 cgd Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -352,8 +352,8 @@
244 UNIMPL proplist_syscall
245 UNIMPL ntp_adjtime
246 UNIMPL ntp_gettime
-247 UNIMPL pathconf
-248 UNIMPL fpathconf
+247 STD { long osf1_sys_pathconf(const char *path, int name); }
+248 STD { long osf1_sys_fpathconf(int fd, int name); }
249 UNIMPL
250 UNIMPL uswitch
251 STD { int osf1_sys_usleep_thread( \
Home |
Main Index |
Thread Index |
Old Index