1 $NetBSD: README.syscalls,v 1.2 1999/04/27 16:09:28 cgd Exp $
3 XXX this file should be gutted. functions' comments should go with
4 XXX the functions. Further, this file is ... very out of date.
6 Once the new syscall argument-handling method was implemented, most
7 OSF/1 syscalls boiled down to their NetBSD equivalents. The
8 differences are detailed in this file.
10 Note that some OSF/1 syscalls, including some of those that map
11 directly to equivalent NetBSD syscalls, are not implemented; they
12 were not needed, so the effort to implement and check them was not
15 Finally, there are some OSF/1 syscalls which were left unimplemented,
16 but which seem strange enough to merit a bit more explanation.
18 OSF/1 compatibility is helped by the fact that the sigcontext
19 structure was created for NetBSD/Alpha to be the same as the OSF/1
20 sigcontext structure. Because of this, only one sendsig() function is
21 needed, and then the NetBSD sigreturn() function can be used for OSF/1
24 The system calls are split out among the three files:
29 osf1_ioctl.c contains all osf1_ioctl() handling code.
30 osf1_mount.c contains all code dealing with mounting and
31 unmounting file systems, and with mount points in
32 general (e.g. osf1_getfsstat()).
33 osf1_misc.c contains the rest of the emulation functions.
35 The emulation functions as follows:
38 dev_t's are different between OSF/1 and NetBSD. In OSF/1 a
39 dev_t has 12 bits of major number and 20 bits of minor number.
40 Under NetBSD, it's 24 bits of major, 8 bits of minor (but the
41 top 16 bits of the major number are unused, and may be
42 rearranged later). In any case, it was decided that the
43 primary use for OSF/1 binaries would be to complement native
44 NetBSD binaries, so file system dev_t's are assumed to be in
45 the NetBSD format, and osf1_mknod() translates from the OSF/1
46 format to the NetBSD format.
49 The statfs structure is different between NetBSD and OSF/1,
50 and the way file system types are denoted is different, as
51 well. This routine is the same as getfsstat(), except it
52 converts the statfs structures before returning them to the
56 To compensate for quad alignment on 32-bit machines, the
57 NetBSD lseek() needs an extra argument of padding, before the
58 off_t 'offset' argument. This wrapper inserts the padding,
59 and calls the NetBSD routine.
62 The file system type specification and the way you specify
63 mount options differs substantially between NetBSD and OSF/1.
64 This routine (and its callees) fakes up NetBSD arguments, and
65 calls the NetBSD routine.
68 Probably not necessary, but safe; translates flags, in case
69 the NetBSD unmount flags ever change.
71 osf1_exec_with_loader() [UNIMPLEMENTED]
72 From the description in the OSF/1 manual page, this executes a
73 file with a named loader, or "/sbin/loader" if none is named.
74 It appears to be used in some way, when executing dynamically
75 linked binaries, but is _not_ called directly from user space
76 in the normal case. The interface by which it passes the name
77 of the file to be executed, its arguments, etc., to the loader
78 is unspecified, and, from experimental evidence, doesn't seem
79 to be the normal UN*X argument-passing convention (i.e.
80 argc/argv). For proper dynamically linked binary support,
81 this function will probably have to be implemented, but it's
82 unclear how that can be done (short of disassembling a lot of
86 Translates OSF/1 flags to NetBSD flags.
89 Screens out ioctl requests that aren't known to work, and
90 translates those that differ between NetBSD and OSF/1.
93 Translates OSF/1 flags to NetBSD flags.
96 The stat structure differs between NetBSD and OSF/1, both in
97 terms of field sizes, and in the dev_t representation.
98 This does a NetBSD stat(), translates the results, and returns
99 them to the OSF/1 process.
102 Same as osf1_stat(), but for lstat().
105 The NetBSD version needs 4 bytes of padding before the off_t
106 'pos' argument, and also uses different flags than the OSF/1
107 version. This wrapper translates the flags and deals with the
108 argument struct padding differences, then calls the NetBSD
112 Same as osf1_stat(), but for fstat().
115 Translates OSF/1 fcntl() requests into their NetBSD
116 counterparts, then calls the NetBSD fcntl() to do the
120 Makes sure that the socket type is valid for NetBSD, and if
121 so, calls NetBSD's socket().
124 Makes sure that the 'flags' argument doesn't use flags that
125 NetBSD can't handle, and calls NetBSD's sendto().
128 Makes sure that the 'which' selector is one that NetBSD can
129 deal with, and calls NetBSD's getrlimit().
132 Same as osf1_getrlimit(), but for setrlimit().
135 Deals with the differences in the NetBSD and OSF/1 sigaction
136 structures, and calls NetBSD's sigaction with the appropriate
137 arguments. If the call requests that the old sigaction be
138 passed back, osf1_sigaction() translates it back to the OSF/1
139 form, and returns it appropriately.
142 Does that statfs() on the given pathname, then translates the
143 NetBSD statfs structure into the one that OSF/1 uses and
144 returns it. Makes a best effort on the mount type, because
145 there's not a one-to-one mapping between NetBSD and OSF/1
149 Same as osf1_statfs(), but for fstatfs().
152 This function is how sleep() and usleep() (and possibly other
153 functions) are implemented in OSF/1. Its usage was discovered
154 by disassembling the library routines that use it. It takes
155 two pointers to timeval structures as arguments. The first
156 contains the amount of time (in seconds and microseconds) to
157 sleep. If the second pointer is non-null, if the process
158 wakes up early, the amount of time "unslept" is returned. If
159 the process doesn't wake up early, zero is returned.
162 A null-op; used early on, but nothing cares that it actually