]> Zhao Yanbai Git Server - minix.git/log
minix.git
13 years agoadd clean clang libraries target
Ben Gras [Mon, 21 Feb 2011 16:07:22 +0000 (16:07 +0000)]
add clean clang libraries target

13 years agoclang: support for building elf using temporary elf-targeted binutils.
Ben Gras [Mon, 21 Feb 2011 16:06:58 +0000 (16:06 +0000)]
clang: support for building elf using temporary elf-targeted binutils.

13 years agoAdd usb message types to com.h
Dirk Vogt [Mon, 21 Feb 2011 15:16:29 +0000 (15:16 +0000)]
Add usb message types to com.h

13 years agomark forked process as such in the kernel p_name
Ben Gras [Mon, 21 Feb 2011 15:05:32 +0000 (15:05 +0000)]
mark forked process as such in the kernel p_name

  . helps debugging output; you can see the difference
    between parent and child easily (it's sometimes
    confusing to see an expected endpoint number with
    an unexpected name, i.e. before exec())
  . when processes crash after fork and before exec, it's
    an instant hint that that's what's going on, instead of
    it being the parent (endpoint numbers don't usually convey
    this)
  . name returns to 'normal' after exec(), so *F isn't visible
    normally at all. (Except for for RS which forks apparently.)

13 years agoUSB chapter 9 definitions
Dirk Vogt [Mon, 21 Feb 2011 14:09:08 +0000 (14:09 +0000)]
USB chapter 9 definitions

13 years agoAdd NBSD-like Minix system includes.
Gianluca Guida [Mon, 21 Feb 2011 13:13:55 +0000 (13:13 +0000)]
Add NBSD-like Minix system includes.

13 years agogrep - letting calloc() return NULL for 0 storage makes grep "" work
Ben Gras [Sun, 20 Feb 2011 13:34:53 +0000 (13:34 +0000)]
grep - letting calloc() return NULL for 0 storage makes grep "" work

13 years agopm - sys_sigsend can fail legitimately
Ben Gras [Fri, 18 Feb 2011 15:44:54 +0000 (15:44 +0000)]
pm - sys_sigsend can fail legitimately

  . specifically, if a signal handler can't be invoked due
    to process memory, EFAULT is returned from the kernel.
    don't panic() then.

13 years agoIncrease maximum filename length for /sys/
Dirk Vogt [Fri, 18 Feb 2011 12:47:25 +0000 (12:47 +0000)]
Increase maximum filename length for /sys/

13 years agoAdd NBSDLibc Minix specific files.
Gianluca Guida [Thu, 17 Feb 2011 17:11:09 +0000 (17:11 +0000)]
Add NBSDLibc Minix specific files.

This patch mainly copies and modifies files existing in
the current libc implementing minix specific functions.

To keep consisten with the NetBSD libc, we remove
namespace stubs and we use "namespace.h" and weak
links.

13 years agocleantmp.c - protect against double definition of NDEBUG
Ben Gras [Wed, 16 Feb 2011 19:04:29 +0000 (19:04 +0000)]
cleantmp.c - protect against double definition of NDEBUG

13 years agoadd NOASSERTS make flag that disables assert()s (NDEBUG=1).
Ben Gras [Wed, 16 Feb 2011 18:58:30 +0000 (18:58 +0000)]
add NOASSERTS make flag that disables assert()s (NDEBUG=1).

  . made some checks in vfs/vnode.c also respond to NDEBUG=1.
  . turned on in release builds

13 years agoClean up NetBSD includes Minix port.
Gianluca Guida [Tue, 15 Feb 2011 20:16:12 +0000 (20:16 +0000)]
Clean up NetBSD includes Minix port.

This patch add the proper .if/.else/.endif to the Makefiles,
and cleans a bit some includes.

The patch containing all changes required by Minix is
nbsd_include/minix-port.patch

13 years ago Fix NetBSD a.out bug in common/libc and port Makefile
Gianluca Guida [Tue, 15 Feb 2011 20:12:04 +0000 (20:12 +0000)]
 Fix NetBSD a.out bug in common/libc and port Makefile

This patch includes the required modifications (summarized
in common/lib/libc/minix-port.patch) to make the common
part of the NetBSD libc to compile and work under Minix.

13 years agoClean up NetBSD libc Minix port.
Gianluca Guida [Tue, 15 Feb 2011 16:31:16 +0000 (16:31 +0000)]
Clean up NetBSD libc Minix port.

This patch add the proper .if/.else/.endif to the Makefiles, add places I forgot #ifdef __minix and remove newlines.

13 years agoPort NetBSD libc functions to Minix.
Gianluca Guida [Tue, 15 Feb 2011 12:19:40 +0000 (12:19 +0000)]
Port NetBSD libc functions to Minix.

This patch contains changes to NetBSD libc code base to make it
compile and work on Minix. Some of them are due to actual NetBSD
libc bugs, as we're compiling it in non-reentrant mode and with
a.out support, something not exactly frequent in NetBSD.
Others are proper fixes to port it to Minix (mostly sa_len
parameter missing in socket and a few mmap from files).

13 years agoThis patch modifies the NetBSD basic includes to be Minix
Gianluca Guida [Tue, 15 Feb 2011 12:03:42 +0000 (12:03 +0000)]
This patch modifies the NetBSD basic includes to be Minix
compatible. There are also changes in the make file, mostly to
let them install in /usr/netbsd/include.

13 years agoImport unmodified NetBSD libc in trunk
Gianluca Guida [Mon, 14 Feb 2011 19:36:03 +0000 (19:36 +0000)]
Import unmodified NetBSD libc in trunk

This patch imports the unmodified current version of NetBSD libc.
The NetBSD includes are in /nbsd_include, while the libc code itself is
split between lib/nbsd_libc and common/lib/libc.

13 years agoUnbreak build by fixing typo.
Gianluca Guida [Mon, 14 Feb 2011 15:15:12 +0000 (15:15 +0000)]
Unbreak build by fixing typo.

Sorry.

13 years ago Use __NBSD_LIBC to specialize common headers for NetBSD headers compilation.
Gianluca Guida [Mon, 14 Feb 2011 15:10:57 +0000 (15:10 +0000)]
 Use __NBSD_LIBC to specialize common headers for NetBSD headers compilation.

This patch contains the required changes (under __NBSD_LIBC definition) of the common headers to compile the NetBSD libc.

13 years agoMove network includes and lib.h into common/include subdir.
Gianluca Guida [Mon, 14 Feb 2011 12:49:18 +0000 (12:49 +0000)]
Move network includes and lib.h into common/include subdir.

This patch moves further includes (the network part and lib.h) in common/.
It is the last part to get the netbsd libc to compile under minix. Further moves will be needed as we get the netbsd libc to compile minix itself.

Also, this patch add #ifndef's to termios.h, as it create problems with netbsd's namespace.h.

13 years agovm: only suspend and resume process with vmctls in pt_writemap in smp mode
Ben Gras [Fri, 11 Feb 2011 14:56:52 +0000 (14:56 +0000)]
vm: only suspend and resume process with vmctls in pt_writemap in smp mode

13 years agousr/Makefile: added missing sh minibootstrap.sh
Ben Gras [Thu, 10 Feb 2011 17:00:02 +0000 (17:00 +0000)]
usr/Makefile: added missing sh minibootstrap.sh

13 years agomemory driver: munmap() imgrd after first close.
Ben Gras [Thu, 10 Feb 2011 15:39:56 +0000 (15:39 +0000)]
memory driver: munmap() imgrd after first close.

(that munmap() range not supported yet by vm.)

13 years agotake pkgsrc.conf out of the base system.
Ben Gras [Thu, 10 Feb 2011 15:05:18 +0000 (15:05 +0000)]
take pkgsrc.conf out of the base system.

  . use bmake for pkgsrc instead, reads mk.conf from /usr/pkg/etc/mk.conf
  . tracking bmake from pkgsrc eases tracking pkgsrc
  . further disentangles pkgsrc from base system, reducing maintenance
    burden of pkgsrc

13 years agominor release.sh fixes and tweaks
Ben Gras [Wed, 9 Feb 2011 16:48:10 +0000 (16:48 +0000)]
minor release.sh fixes and tweaks

- pre-install bmake for further (future) base/pkgsrc disentanglement
- print url properly for pre-install source
- correct <minix/sys_config.h> source location

13 years agotop - able to account kernel cpu time to process
Ben Gras [Tue, 8 Feb 2011 14:00:48 +0000 (14:00 +0000)]
top - able to account kernel cpu time to process

13 years agoprocfs - export extra kernel time accounting fields
Ben Gras [Tue, 8 Feb 2011 13:59:21 +0000 (13:59 +0000)]
procfs - export extra kernel time accounting fields

13 years agokernel - account for kernel cpu time (ipc, kcalls) in caller
Ben Gras [Tue, 8 Feb 2011 13:58:32 +0000 (13:58 +0000)]
kernel - account for kernel cpu time (ipc, kcalls) in caller

13 years agokernel - change print*() functions for ipc to generic ipc hook functions.
Ben Gras [Tue, 8 Feb 2011 13:54:33 +0000 (13:54 +0000)]
kernel - change print*() functions for ipc to generic ipc hook functions.

  - used to implement ipc stats tracking code

13 years agoMove shared headers in common/include
Gianluca Guida [Sun, 6 Feb 2011 22:59:02 +0000 (22:59 +0000)]
Move shared headers in common/include

Headers that will be shared between old includes and NetBSD-like includes
are moved into common/include tree. They are still copied in /usr/include
in 'make includes', so compilation and programs aren't be affected.

13 years agoinclude - throw out gettiminglocks stuff from include
Ben Gras [Fri, 4 Feb 2011 13:42:54 +0000 (13:42 +0000)]
include - throw out gettiminglocks stuff from include

13 years agokernel - doesn't do lock timings any more
Ben Gras [Fri, 4 Feb 2011 13:42:17 +0000 (13:42 +0000)]
kernel - doesn't do lock timings any more

13 years agois - no more getlocktimings.
Ben Gras [Fri, 4 Feb 2011 13:34:43 +0000 (13:34 +0000)]
is - no more getlocktimings.

13 years agoFix comment mutilated by find/replace
Erik van der Kouwe [Wed, 2 Feb 2011 14:53:49 +0000 (14:53 +0000)]
Fix comment mutilated by find/replace

13 years ago/usr/Makefile - automatically update pkgin database too.
Ben Gras [Mon, 31 Jan 2011 16:53:53 +0000 (16:53 +0000)]
/usr/Makefile - automatically update pkgin database too.

13 years ago/usr/Makefile - automatically install git
Ben Gras [Mon, 31 Jan 2011 00:58:50 +0000 (00:58 +0000)]
/usr/Makefile - automatically install git

13 years agosome extra math functions from netbsd for netpbm.
Ben Gras [Sun, 30 Jan 2011 23:40:51 +0000 (23:40 +0000)]
some extra math functions from netbsd for netpbm.

13 years agoalways define PKG_TOOLS_BIN
Ben Gras [Sun, 30 Jan 2011 23:36:45 +0000 (23:36 +0000)]
always define PKG_TOOLS_BIN

13 years ago<ansi.h> -> <minix/ansi.h>
Ben Gras [Fri, 28 Jan 2011 11:50:47 +0000 (11:50 +0000)]
<ansi.h> -> <minix/ansi.h>

13 years ago<ansi.h> -> <minix/ansi.h>
Ben Gras [Fri, 28 Jan 2011 11:35:02 +0000 (11:35 +0000)]
<ansi.h> -> <minix/ansi.h>

13 years agotake pkg_install out of the base system and pre-install it using the
Ben Gras [Fri, 28 Jan 2011 00:02:27 +0000 (00:02 +0000)]
take pkg_install out of the base system and pre-install it using the
pkgsrc binary packages.

rationale:
  . pkg_install (which is the pkg_* tools) is entangled with pkgsrc,
    not with minix, so tracking it from pkgsrc (easier than with
    base system) makes more sense
  . simplifies upstreaming minix specific changes for pkg_* tools
  . reduce pkgsrc-in-basesystem maintenance burden

13 years agoupdate package names in packages.install to new pkgsrc versions
Ben Gras [Thu, 27 Jan 2011 23:59:02 +0000 (23:59 +0000)]
update package names in packages.install to new pkgsrc versions

13 years agoRemove code for kernel task stack initialization
Arun Thomas [Thu, 27 Jan 2011 12:18:33 +0000 (12:18 +0000)]
Remove code for kernel task stack initialization

We no longer have kernel tasks, so this code is unnecessary

13 years agoadd minix3.org pkgsrc mirror as backup source
Ben Gras [Wed, 26 Jan 2011 17:02:54 +0000 (17:02 +0000)]
add minix3.org pkgsrc mirror as backup source

13 years agoadded uint typedef declaration in <minix/types.h>
Ben Gras [Wed, 26 Jan 2011 14:36:19 +0000 (14:36 +0000)]
added uint typedef declaration in <minix/types.h>

  . needed for xmlrpc (needed for cmake (needed for compiler-rt))

13 years agoadded <complex.h> (needed for compiler-rt)
Ben Gras [Wed, 26 Jan 2011 14:35:34 +0000 (14:35 +0000)]
added <complex.h> (needed for compiler-rt)

13 years agoKernel: fix clearing IPC references resulting in system crash
David van Moolenbroek [Tue, 18 Jan 2011 10:18:08 +0000 (10:18 +0000)]
Kernel: fix clearing IPC references resulting in system crash

13 years agoServers request TSC freq from kernel rather than each one measuring it individually
Erik van der Kouwe [Tue, 11 Jan 2011 11:03:37 +0000 (11:03 +0000)]
Servers request TSC freq from kernel rather than each one measuring it individually

13 years agoRS: don't share executable images with a dead process
David van Moolenbroek [Fri, 7 Jan 2011 17:10:12 +0000 (17:10 +0000)]
RS: don't share executable images with a dead process

13 years agoRS: move setuid() hack to where it belongs.. again.
David van Moolenbroek [Fri, 7 Jan 2011 17:09:30 +0000 (17:09 +0000)]
RS: move setuid() hack to where it belongs.. again.

13 years agoDS: fix regression in ds_subscribe regex construction
David van Moolenbroek [Fri, 7 Jan 2011 17:07:46 +0000 (17:07 +0000)]
DS: fix regression in ds_subscribe regex construction

13 years agoDS: update subscriptions for deleted keys upon process exit
David van Moolenbroek [Fri, 7 Jan 2011 17:06:24 +0000 (17:06 +0000)]
DS: update subscriptions for deleted keys upon process exit

13 years agoKernel: fix notification delivery to non-ANY receivers
David van Moolenbroek [Fri, 7 Jan 2011 17:04:43 +0000 (17:04 +0000)]
Kernel: fix notification delivery to non-ANY receivers

13 years agoremove fsck1 altogether
David van Moolenbroek [Tue, 21 Dec 2010 11:00:13 +0000 (11:00 +0000)]
remove fsck1 altogether

13 years agochange bitchunk_t from 16-bit to 32-bit
David van Moolenbroek [Tue, 21 Dec 2010 10:44:45 +0000 (10:44 +0000)]
change bitchunk_t from 16-bit to 32-bit

13 years agosys/queue.h: add LIST_FOREACH_SAFE
David van Moolenbroek [Mon, 20 Dec 2010 23:52:53 +0000 (23:52 +0000)]
sys/queue.h: add LIST_FOREACH_SAFE

13 years agoFix multiboot for ACK-built images
Arun Thomas [Fri, 17 Dec 2010 13:47:11 +0000 (13:47 +0000)]
Fix multiboot for ACK-built images

Move the profiling buffer to the end of the data segment

13 years agoKernel: statistical profiling fixes
David van Moolenbroek [Thu, 16 Dec 2010 09:46:26 +0000 (09:46 +0000)]
Kernel: statistical profiling fixes

- create name entries for forked processes as well;
- create name entries only for system processes.

13 years agovfs - use a static buffer instead of malloc()+free(), solving
Ben Gras [Wed, 15 Dec 2010 14:43:59 +0000 (14:43 +0000)]
vfs - use a static buffer instead of malloc()+free(), solving
recently appeared ENOMEM problems during exec().

13 years agoWorkaround for circular dependency problem in pkgadd
Erik van der Kouwe [Sat, 11 Dec 2010 18:20:31 +0000 (18:20 +0000)]
Workaround for circular dependency problem in pkgadd

13 years agolibc and csu updates for ELF
Arun Thomas [Fri, 10 Dec 2010 23:04:04 +0000 (23:04 +0000)]
libc and csu updates for ELF

13 years agocsu/build support for ELF
Arun Thomas [Fri, 10 Dec 2010 22:20:12 +0000 (22:20 +0000)]
csu/build support for ELF

13 years agomkfifo.c: fix ack warning
David van Moolenbroek [Fri, 10 Dec 2010 15:21:59 +0000 (15:21 +0000)]
mkfifo.c: fix ack warning

13 years agounstack: ELF support
Arun Thomas [Fri, 10 Dec 2010 15:18:30 +0000 (15:18 +0000)]
unstack: ELF support

13 years agofile(1): Add ELF support
Arun Thomas [Fri, 10 Dec 2010 15:18:28 +0000 (15:18 +0000)]
file(1): Add ELF support

13 years agoFix libname in bsd.prog.mk
Arun Thomas [Fri, 10 Dec 2010 09:33:48 +0000 (09:33 +0000)]
Fix libname in bsd.prog.mk

13 years agoVFS/RS support for ELF
Arun Thomas [Fri, 10 Dec 2010 09:27:56 +0000 (09:27 +0000)]
VFS/RS support for ELF

13 years agoRS: fix IPC privilege computation bug
David van Moolenbroek [Wed, 8 Dec 2010 14:54:08 +0000 (14:54 +0000)]
RS: fix IPC privilege computation bug

Take into account the ALL and ALL_SYS cases when constructing proper
symmetrical IPC send masks. Fix system.conf accordingly, to keep
userland processes from sending to several non-interface servers and
drivers. Also fix IS's F4 formatting.

13 years agosystem.conf: base ipc permissions on process names rather than labels
David van Moolenbroek [Tue, 7 Dec 2010 12:16:31 +0000 (12:16 +0000)]
system.conf: base ipc permissions on process names rather than labels

From now on, the "ipc" directive in system.conf refers to process names
instead of labels, similar to the "control" directive. The old, more
fine-grained approach is deemed unnecessary and cumbersome at this time.

As side effects, this patch unbreaks late IPC permission computation as
well as the filter driver.

13 years agoKernel/RS: fix permission computation with 32+ system processes
David van Moolenbroek [Tue, 7 Dec 2010 10:32:42 +0000 (10:32 +0000)]
Kernel/RS: fix permission computation with 32+ system processes

13 years agoRS: do not restart file systems
David van Moolenbroek [Fri, 3 Dec 2010 13:19:15 +0000 (13:19 +0000)]
RS: do not restart file systems

13 years agovfs: terminate string in rdlink_direct
Arun Thomas [Wed, 1 Dec 2010 16:24:50 +0000 (16:24 +0000)]
vfs: terminate string in rdlink_direct

Fixes test56 when compiled with GCC.

13 years agoFix missing parenthesis (suggested by Antoine Leca)
Erik van der Kouwe [Mon, 29 Nov 2010 08:30:30 +0000 (08:30 +0000)]
Fix missing parenthesis (suggested by Antoine Leca)

13 years agomkboot: include git id in image name if available.
Ben Gras [Thu, 25 Nov 2010 15:25:17 +0000 (15:25 +0000)]
mkboot: include git id in image name if available.

13 years agoremoved unneeded global var
Dirk Vogt [Wed, 24 Nov 2010 16:30:13 +0000 (16:30 +0000)]
removed unneeded global var

13 years agodon't send FS_READY anymore
Dirk Vogt [Wed, 24 Nov 2010 16:29:50 +0000 (16:29 +0000)]
don't send FS_READY anymore

13 years agoFix for objdir feature of BSD make
Ben Gras [Wed, 24 Nov 2010 13:44:42 +0000 (13:44 +0000)]
Fix for objdir feature of BSD make

contributed by Antoine Leca.

13 years agodecouple file system server start/termination from mount/umount
Dirk Vogt [Tue, 23 Nov 2010 19:34:56 +0000 (19:34 +0000)]
decouple file system server start/termination from mount/umount

13 years agopkgsrc: Update git repo info
Arun Thomas [Tue, 23 Nov 2010 11:12:06 +0000 (11:12 +0000)]
pkgsrc: Update git repo info

13 years agoAdd machine/param.h
Arun Thomas [Tue, 23 Nov 2010 11:05:09 +0000 (11:05 +0000)]
Add machine/param.h

13 years agoFor GCC/clang, don't build in ACK int64 routines
Arun Thomas [Fri, 19 Nov 2010 12:36:44 +0000 (12:36 +0000)]
For GCC/clang, don't build in ACK int64 routines

13 years agoAllow for overriding GCC var in test Makefile
Arun Thomas [Fri, 19 Nov 2010 10:33:26 +0000 (10:33 +0000)]
Allow for overriding GCC var in test Makefile

13 years agokernel: Use LIBDIR var in Makefile
Arun Thomas [Fri, 19 Nov 2010 10:28:17 +0000 (10:28 +0000)]
kernel: Use LIBDIR var in Makefile

Instead of using a hard-coded path, use the LIBDIR variable so
the library path can be overridden.

13 years agoInlining 64bit integer handling functions
Tomas Hruby [Thu, 18 Nov 2010 16:37:40 +0000 (16:37 +0000)]
Inlining 64bit integer handling functions

- if gcc/clang is used the C functions that use long long can be
  inlined to get better performance (yes, it makes difference)

13 years agokernel/debug.c includes u64.h (fix)
Tomas Hruby [Thu, 18 Nov 2010 15:12:01 +0000 (15:12 +0000)]
kernel/debug.c includes u64.h (fix)

13 years agolibdriver without mandatory driver main loop
Dirk Vogt [Wed, 17 Nov 2010 15:10:20 +0000 (15:10 +0000)]
libdriver without mandatory driver main loop

13 years agoAdded possibility to inject input events to tty
Dirk Vogt [Wed, 17 Nov 2010 14:53:07 +0000 (14:53 +0000)]
Added possibility to inject input events to tty

M    include/Makefile
A    include/minix/input.h
M    include/minix/com.h
M    drivers/tty/keyboard.c
M    drivers/tty/tty.c
M    drivers/tty/tty.h
M    include/minix/syslib.h
M    lib/libsys/Makefile
A    lib/libsys/input.c

13 years agorevert r8783, as those entries are auto-generated now
Ben Gras [Wed, 17 Nov 2010 14:29:32 +0000 (14:29 +0000)]
revert r8783, as those entries are auto-generated now

13 years ago. auto-generate per-directory .gitignore files based on $(CLEANFILES)
Ben Gras [Wed, 17 Nov 2010 14:28:23 +0000 (14:28 +0000)]
. auto-generate per-directory .gitignore files based on $(CLEANFILES)
. gitignore .gitignore files except for the root one.

13 years agoUpdated some CLEANFILES macros in Makefiles.
Ben Gras [Wed, 17 Nov 2010 14:27:23 +0000 (14:27 +0000)]
Updated some CLEANFILES macros in Makefiles.

13 years agoUpdate gitignore
Arun Thomas [Mon, 15 Nov 2010 15:59:59 +0000 (15:59 +0000)]
Update gitignore

13 years agoRemove redundant sha2 code from inet
Arun Thomas [Mon, 15 Nov 2010 11:10:02 +0000 (11:10 +0000)]
Remove redundant sha2 code from inet

14 years agoGCC/clang: int64 routines in C
Arun Thomas [Fri, 12 Nov 2010 18:38:10 +0000 (18:38 +0000)]
GCC/clang: int64 routines in C

14 years agoRemove global variable 'i'
Erik van der Kouwe [Thu, 11 Nov 2010 14:12:48 +0000 (14:12 +0000)]
Remove global variable 'i'

14 years agoupdate for releases with git.
Ben Gras [Thu, 11 Nov 2010 02:00:12 +0000 (02:00 +0000)]
update for releases with git.

14 years agoUse int64 functions consistently
Arun Thomas [Sun, 7 Nov 2010 23:35:29 +0000 (23:35 +0000)]
Use int64 functions consistently

Instead of manipulating the u64_t type directly, use the
ex64hi()/ex64lo()/make64() functions.

14 years agoImport mkfifo(1) from NetBSD
Arun Thomas [Sat, 6 Nov 2010 20:43:49 +0000 (20:43 +0000)]
Import mkfifo(1) from NetBSD

14 years agoImport mktemp(1) from NetBSD
Arun Thomas [Sat, 6 Nov 2010 20:41:51 +0000 (20:41 +0000)]
Import mktemp(1) from NetBSD

14 years agoMove minix/paths.h to paths.h
Arun Thomas [Sat, 6 Nov 2010 20:40:15 +0000 (20:40 +0000)]
Move minix/paths.h to paths.h

Also, merge in relevant macros from NetBSD