From owner-freebsd-hackers Sun Jul 9 6:10: 4 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from danbala.tuwien.ac.at (danbala.ifoer.tuwien.ac.at [128.130.168.64]) by hub.freebsd.org (Postfix) with ESMTP id 5A23837B63B; Sun, 9 Jul 2000 06:09:47 -0700 (PDT) (envelope-from wiz@danbala.tuwien.ac.at) Received: (from wiz@localhost) by danbala.tuwien.ac.at (8.8.8/8.8.8) id PAA01506; Sun, 9 Jul 2000 15:09:25 +0200 (MEST) Date: Sun, 9 Jul 2000 15:09:24 +0200 From: Thomas Klausner To: freebsd-arch@freebsd.org, freebsd-hackers@freebsd.org, tech-kern@netbsd.org, tech@openbsd.org Cc: wiz@netbsd.org Subject: minherit(2) API Message-ID: <20000709150924.N23637@danbala.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, The user API for minherit(2) is broken on all three of {Free,Net,Open}BSD, but broken differently (for details see end of this mail). We would like to see a common fix that allows minherit to be used portably across the three systems. The API we propose: synopsis for minherit: #include int minherit(void *addr, size_t len, int inherit); constants for inherit parameter defined in sys/mman.h: #define MAP_INHERIT_SHARE 0 /* share with child */ #define MAP_INHERIT_COPY 1 /* copy into child */ #define MAP_INHERIT_NONE 2 /* absent from child */ possibly including the following: #define MAP_INHERIT_DONATE_COPY 3 /* copy and delete */ #define MAP_INHERIT_DEFAULT MAP_INHERIT_COPY (donate copy is not present in FreeBSD, default is not documented in the man pages of any of the three). We propose the addition of these constant definitions to sys/mman.h to avoid requiring the inclusion of kernel internal vm header files. We propose the renaming of these constants from VM_INHERIT_ to MAP_INHERIT_ to avoid name space pollution (the MAP_ prefix is reserved for sys/mman.h by POSIX, VM_ is not). That this change is not backwards compatible is of little concern, since it is currently broken anyway. Besides, a C program can check for the definition of the MAP_INHERIT_ constants after including sys/mman.h and include conditional workarounds for the current APIs. The current state of affairs on each system: FreeBSD: synopsis: #include #include int minherit(void *addr, size_t len, int inherit); VM_INHERIT_ constants are neither documented nor declared in any user header. NetBSD: synopsis: #include #include int minherit(void *addr, size_t len, int inherit); VM_INHERIT_ constants are not declared in any user header. OpenBSD: synopsis: #include #include #include int minherit(void *addr, size_t len, int inherit); vm/vm_inherit.h does not declare the type vm_inherit_t (but uses it for the definition of the VM_INHERIT_ constants); furthermore, vm/vm_inherit.h is an internal kernel header. I wasn't sure which FreeBSD mailing list is more appropriate, so I took both. Please CC: any answers to the other lists, too. Bye, Thomas Klausner -- Thomas Klausner - wiz@netbsd.org I wanted to emulate some of my heroes, but I didn't know their op-codes. --dowe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message