NetBSD Problem Report #8622
Received: (qmail 1026 invoked from network); 14 Oct 1999 05:31:52 -0000
Message-Id: <199910140520.WAA00468@cobalt.plectere.com>
Date: Wed, 13 Oct 1999 22:20:31 -0700 (PDT)
From: paul@plectere.com
Reply-To: paul@plectere.com
To: gnats-bugs@gnats.netbsd.org
Subject: FreeBSD compat support fails for FreeBSD-current binaries.
X-Send-Pr-Version: 3.95
>Number: 8622
>Category: kern
>Synopsis: FreeBSD -current binaries crash.
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: jdolecek
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Wed Oct 13 22:33:00 +0000 1999
>Closed-Date: Sat Oct 27 10:03:41 +0000 2001
>Last-Modified: Sat Oct 27 10:03:41 +0000 2001
>Originator: Paul Shupak
>Release: NetBSD-current Mon Oct 11 1999
>Organization:
>Environment:
System: NetBSD cobalt 1.4L NetBSD 1.4L (COBALT) #211: Mon Oct 11 19:32:36 PDT 1999 paul@cobalt:/usr/src/sys/arch/i386/compile/COBALT i386
>Description:
FreeBSD -current has added several new (to FreeBSD) systems calls.
These calls cause binaries to fail (i.e. exit w/ SIGSYS).
>How-To-Repeat:
Run a FreeBSD-current "/bin/pwd"
>Fix:
The following patches allow most FreeBSD -current programs to run again.
( notable exceptions are "sysctl" and some instances of "dd" )
tested only on i386, not Alpha.
*** files.freebsd-ORIG Mon Oct 11 19:15:07 1999
--- files.freebsd Mon Oct 11 19:26:05 1999
***************
*** 16 ****
--- 16,17 ----
file compat/freebsd/freebsd_syscalls.c compat_freebsd
+ file compat/freebsd/freebsd_sigaction.c compat_freebsd
*** /dev/null Wed Oct 13 02:08:53 1999
--- freebsd_sigaction.h Mon Oct 11 19:27:38 1999
***************
*** 0 ****
--- 1,16 ----
+ /* $NetBSD: freebsd_sigaction.h,v 1.0 1999/10/05 23:59:59 paul Exp $ */
+
+ #ifndef _FREEBSD_SIGACTION_H
+ #define _FREEBSD_SIGACTION_H 1
+
+ #ifdef _KERNEL
+
+ struct freebsd_sigaction { /* A lie, but good enough */
+ void (*sa_handler) __P((int)); /* signal handler */
+ int sa_flags;
+ sigset_t sa_mask; /* signal mask to apply */
+ };
+
+ #endif /* !_KERNEL */
+
+ #endif /* _FREEBSD_SIGACTION_H */
*** /dev/null Wed Oct 13 02:08:53 1999
--- freebsd_sigaction.c Mon Oct 11 19:28:52 1999
***************
*** 0 ****
--- 1,79 ----
+ /* $NetBSD: freebsd_sigaction.c,v 1.0 1999/10/05 23:59:59 paul Exp $ */
+
+ #include <sys/param.h>
+ #include <sys/systm.h>
+ #include <sys/proc.h>
+ #include <sys/filedesc.h>
+ #include <sys/mount.h>
+ #include <sys/kernel.h>
+ #include <sys/signal.h>
+ #include <sys/signalvar.h>
+
+ #include <sys/syscallargs.h>
+
+ #include <compat/freebsd/freebsd_sigaction.h>
+ #include <compat/freebsd/freebsd_syscallargs.h>
+
+ static void freebsd_to_native_sigaction __P(( struct sigaction *pnsa,
+ const struct freebsd_sigaction *pfsa));
+ static void native_to_freebsd_sigaction __P(( struct freebsd_sigaction *pfsa,
+ const struct sigaction *pnsa));
+
+ static void
+ freebsd_to_native_sigaction(pnsa, pfsa)
+ struct sigaction *pnsa;
+ const struct freebsd_sigaction *pfsa;
+ {
+ pnsa->sa_handler = pfsa->sa_handler;
+ pnsa->sa_flags = pfsa->sa_flags;
+ memcpy(&pnsa->sa_mask, &pfsa->sa_mask, sizeof pnsa->sa_mask);
+
+ return;
+ }
+
+ static void
+ native_to_freebsd_sigaction(pfsa, pnsa)
+ struct freebsd_sigaction *pfsa;
+ const struct sigaction *pnsa;
+ {
+ pfsa->sa_handler = pnsa->sa_handler;
+ pfsa->sa_flags = pnsa->sa_flags;
+ memcpy(&pfsa->sa_mask, &pnsa->sa_mask, sizeof pnsa->sa_mask);
+
+ return;
+ }
+
+ /* ARGSUSED */
+ int
+ freebsd_sys__sigaction(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+ {
+ struct freebsd_sys__sigaction_args /* {
+ syscallarg(int) signum;
+ syscallarg(const struct freebsd_sigaction *) nsa;
+ syscallarg(struct freebsd_sigaction *) osa;
+ } */ *uap = v;
+ struct sigaction nsa, osa;
+ struct freebsd_sigaction nfsa, ofsa;
+ int error;
+
+ if (SCARG(uap, nsa)) {
+ error = copyin(SCARG(uap, nsa), &nfsa, sizeof nfsa);
+ if (error)
+ return error;
+ freebsd_to_native_sigaction(&nsa, &nfsa);
+ }
+ error = sigaction1(p, SCARG(uap, signum),
+ SCARG(uap, nsa) ? &nsa : 0, SCARG(uap, osa) ? &osa : 0);
+ if (error)
+ return error;
+ if (SCARG(uap, osa)) {
+ native_to_freebsd_sigaction(&ofsa, &osa);
+ error = copyout(&ofsa, SCARG(uap, osa), sizeof ofsa);
+ if (error)
+ return error;
+ }
+ return 0;
+ }
*** syscalls.master-ORIG Wed Aug 25 04:44:18 1999
--- syscalls.master Mon Oct 11 17:53:25 1999
***************
*** 291,295 ****
; Some of these calls are now supported by BSD...
! 151 UNIMPL
! 152 UNIMPL
! 153 UNIMPL
154 UNIMPL
--- 291,295 ----
; Some of these calls are now supported by BSD...
! 151 UNIMPL sem_lock
! 152 UNIMPL sem_wakeup
! 153 UNIMPL asyncdaemon
154 UNIMPL
***************
*** 298,300 ****
#else
! 155 UNIMPL
#endif
--- 298,300 ----
#else
! 155 UNIMPL nfssvc
#endif
***************
*** 345,353 ****
172 UNIMPL
! 173 UNIMPL
! 174 UNIMPL
175 UNIMPL
176 STD { int freebsd_ntp_adjtime(struct freebsd_timex *tp); }
! 177 UNIMPL
! 178 UNIMPL
! 179 UNIMPL
180 UNIMPL
--- 345,355 ----
172 UNIMPL
! 173 NOARGS { ssize_t sys_pread(int fd, void *buf, \
! size_t nbyte, int pad, off_t offset); }
! 174 NOARGS { ssize_t sys_pwrite(int fd, const void *buf, \
! size_t nbyte, int pad, off_t offset); }
175 UNIMPL
176 STD { int freebsd_ntp_adjtime(struct freebsd_timex *tp); }
! 177 UNIMPL sfork
! 178 UNIMPL getdescriptor
! 179 UNIMPL setdescriptor
180 UNIMPL
***************
*** 366,371 ****
#else
! 184 UNIMPL
! 185 UNIMPL
! 186 UNIMPL
! 187 UNIMPL
#endif
--- 368,373 ----
#else
! 184 UNIMPL lfs_bmapv
! 185 UNIMPL lfs_markv
! 186 UNIMPL lfs_segclean
! 187 UNIMPL lfs_segwait
#endif
***************
*** 401,403 ****
#else
! 205 UNIMPL
#endif
--- 403,405 ----
#else
! 205 UNIMPL undelete
#endif
***************
*** 492,494 ****
; syscall numbers initially used in OpenBSD
! 250 UNIMPL minherit
251 UNIMPL rfork
--- 494,497 ----
; syscall numbers initially used in OpenBSD
! 250 NOARGS { int sys_minherit(void *addr, size_t len, \
! int inherit); }
251 UNIMPL rfork
***************
*** 542,546 ****
296 UNIMPL
! 297 UNIMPL
! 298 UNIMPL
! 299 UNIMPL
; syscall numbers for FreeBSD
--- 545,551 ----
296 UNIMPL
! 297 NOARGS { int sys_fhstatfs(const fhandle_t *fhp, \
! struct statfs *buf); }
! 298 NOARGS { int sys_fhopen(const fhandle_t *fhp, int flags); }
! 299 NOARGS { int sys_fhstat(const fhandle_t *fhp, \
! struct stat *sb); }
; syscall numbers for FreeBSD
***************
*** 556,558 ****
309 UNIMPL kldfirstmod
! 310 UNIMPL getsid
311 UNIMPL setresuid
--- 561,563 ----
309 UNIMPL kldfirstmod
! 310 NOARGS { pid_t sys_getsid(pid_t pid); }
311 UNIMPL setresuid
***************
*** 570,574 ****
323 UNIMPL thr_wakeup
! 324 UNIMPL mlockall
! 325 UNIMPL munlockall
! 326 UNIMPL __getcwd
327 UNIMPL sched_setparam
--- 575,579 ----
323 UNIMPL thr_wakeup
! 324 NOARGS { int sys_mlockall(int flags); }
! 325 NOARGS { int sys_munlockall(void); }
! 326 NOARGS { int sys___getcwd(char *bufp, size_t length); }
327 UNIMPL sched_setparam
***************
*** 584 ****
--- 589,602 ----
337 UNIMPL kldsym
+ 338 UNIMPL jail
+ 339 UNIMPL pioctl
+ 340 NOARGS { int sys___sigprocmask14(int how, \
+ const sigset_t *set, \
+ sigset_t *oset); }
+ 341 NOARGS { int sys___sigsuspend14(const sigset_t *set); }
+ 342 STD { int freebsd_sys__sigaction(int signum, \
+ const struct freebsd_sigaction *nsa, \
+ struct freebsd_sigaction *osa); }
+ 343 NOARGS { int sys___sigpending14(sigset_t *set); }
+ 344 UNIMPL sigreturn
+ 345 UNIMPL sigtimedwait
+ 346 UNIMPL sigwaitinfo
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->jdolecek
Responsible-Changed-By: jdolecek
Responsible-Changed-When: Thu Oct 18 11:48:27 PDT 2001
Responsible-Changed-Why:
I'm collecting emulation-specific PRs.
State-Changed-From-To: open->closed
State-Changed-By: jdolecek
State-Changed-When: Sat Oct 27 03:03:26 PDT 2001
State-Changed-Why:
Fixed. Thanks for report.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.