On Tue, 04 Dec 2007 03:04:29 -0800, xiantingmanbu wrote:
> How many system call do OPENBSD provide?
man -k . | grep "(2)" | wc -l
;-)
This is a discussion on system call - BSD ; How many system call do OPENBSD provide?...
How many system call do OPENBSD provide?
On Tue, 04 Dec 2007 03:04:29 -0800, xiantingmanbu wrote:
> How many system call do OPENBSD provide?
man -k . | grep "(2)" | wc -l
;-)
x-no-archive: yes
Hi!
Mark Southwrote:
>On Tue, 04 Dec 2007 03:04:29 -0800, xiantingmanbu wrote:
>> How many system call do OPENBSD provide?
>man -k . | grep "(2)" | wc -l
Outputs 0
$ man -k '' | fgrep "(2)" | wc -l
Outputs 129
$ cd /usr/src/sys/kern
$ grep '^[0-9]' syscalls.master |awk '($2 == "STD")'|wc -l
Outputs 186
Guess which is more accurate...
>;-)
Kind regards,
Hannah.
On 2007-12-04, Mark Southwrote:
> On Tue, 04 Dec 2007 03:04:29 -0800, xiantingmanbu wrote:
>
>> How many system call do OPENBSD provide?
>
> man -k . | grep "(2)" | wc -l
Clever. But apropos doesn't take the dot as a wildcard
character, rather as a literal dot. The command you'd want is
$ man -k "" | grep "(2)" | wc -l
128
But this doesn't really work, either, as there isn't a 1:1
correspondence between man pages and system calls; stat, lstat, and
fstat are all described on the same manual page, for example. It
might improve things to count how many C library functions are
described in each man page in section 2:
$ man -k "" | perl -ne 's/(.+) \(2\).*$/$1/g || next; s/, /\n/g;
print;' | wc -l
180
But that still doesn't give us an accurate answer
So my real answer for the original poster is: install the system
source code, if it isn't installed already, and take a look at
/usr/src/sys/kern/syscalls.master and /usr/src/sys/sys/syscall.h.
Read syscall(9) for more information.
--
Mark Shroyer
http://markshroyer.com/contact/
On Tue, 04 Dec 2007 07:54:30 -0500, Mark Shroyer wrote:
> On 2007-12-04, Mark Southwrote:
>> On Tue, 04 Dec 2007 03:04:29 -0800, xiantingmanbu wrote:
>>
>>> How many system call do OPENBSD provide?
>>
>> man -k . | grep "(2)" | wc -l
>
> Clever. But apropos doesn't take the dot as a wildcard
> character, rather as a literal dot. The command you'd want is
>
> $ man -k "" | grep "(2)" | wc -l
> 128
Damn, I mixed my shells again....
> But this doesn't really work, either, as there isn't a 1:1
> correspondence between man pages and system calls; stat, lstat, and
> fstat are all described on the same manual page, for example. It
> might improve things to count how many C library functions are
> described in each man page in section 2:
>
> $ man -k "" | perl -ne 's/(.+) \(2\).*$/$1/g || next; s/, /\n/g;
> print;' | wc -l
> 180
>
> But that still doesn't give us an accurate answer
I wasn't taking the question seriously, I mean, in what way is the number
of system calls a useful parameter of an OS?????????
> So my real answer for the original poster is: install the system
> source code, if it isn't installed already, and take a look at
> /usr/src/sys/kern/syscalls.master and /usr/src/sys/sys/syscall.h.
> Read syscall(9) for more information.
That's the best advice so far.
On Tue, 04 Dec 2007 12:50:21 +0000, Hannah wrote:
> x-no-archive: yes
>
> Hi!
>
> Mark Southwrote:
>>On Tue, 04 Dec 2007 03:04:29 -0800, xiantingmanbu wrote:
>
>>> How many system call do OPENBSD provide?
>
>>man -k . | grep "(2)" | wc -l
>
> Outputs 0
>
> $ man -k '' | fgrep "(2)" | wc -l
>
> Outputs 129
>
> $ cd /usr/src/sys/kern
> $ grep '^[0-9]' syscalls.master |awk '($2 == "STD")'|wc -l
>
> Outputs 186
I'm sure someone will be along in a moment with a perl script that
summarises the man page for each one, too ;-)
> Guess which is more accurate...
As I said in another reply, the question seems bizarre without knowing why
the OP needs to know....
On 2007-12-04, Mark Southwrote:
[ ... ]
> I wasn't taking the question seriously, I mean, in what way is the number
> of system calls a useful parameter of an OS?????????
Someone is looking for arguing points to show that his choice of
OS is better than any other. :-)
Enjoy,
DoN.
--
Email:| Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
--- Black Holes are where God is dividing by zero ---
On Wed, 05 Dec 2007 04:52:07 +0000, DoN. Nichols wrote:
> On 2007-12-04, Mark Southwrote:
>
> [ ... ]
>
>> I wasn't taking the question seriously, I mean, in what way is the number
>> of system calls a useful parameter of an OS?????????
>
> Someone is looking for arguing points to show that his choice of
> OS is better than any other. :-)
It's a long time since I looked at the Windows API (shudder), but I'm sure
it beats every other OS by that measure of quality.
Actually, it looked more like a homework question to me in the first place....
On 2007-12-05, Mark Southwrote:
> On Wed, 05 Dec 2007 04:52:07 +0000, DoN. Nichols wrote:
>
>> On 2007-12-04, Mark Southwrote:
>>
>>> I wasn't taking the question seriously, I mean, in what way is
>>> the number of system calls a useful parameter of an OS?????????
>>
>> Someone is looking for arguing points to show that his choice of
>> OS is better than any other. :-)
>
> It's a long time since I looked at the Windows API (shudder), but
> I'm sure it beats every other OS by that measure of quality.
>
> Actually, it looked more like a homework question to me in the
> first place....
That was my first thought, too; my university's Operating Systems
course used to be taught with OpenBSD. (But they later switched to
a derivative of MINIX 2 that had been ported to run as a Solaris
process, so that students would be able to run and modify the
operating systems on their Unix shell accounts. Because, you know,
the last thing you want to ask Operating Systems students to do is
to figure out how to install an operating system on their own
hardware or virtual machines.)
--
Mark Shroyer
http://markshroyer.com/contact/