Complete.Org: Mailing Lists: Archives: linux-help: June 2000:
[linux-help] Blood and Guts
Home

[linux-help] Blood and Guts

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: linux-help@xxxxxxxxx
Subject: [linux-help] Blood and Guts
From: "Lrs v.d.Ast" <mrprenzl@xxxxxxxxxx>
Date: Wed, 07 Jun 2000 11:01:24 -0500
Reply-to: linux-help@xxxxxxxxx

Hallo Linux C gurus:

I was poking around with man pages and I found the write(2) systems call. It
writes to a file descriptor (the default is 1, standard output). As I
understand printf calls this to actually get the "printing" done. I started
poking around the #include file, unistd.h (required to use write), and I found
a (for me) the cryptic lines:

extern ssize_t __write __P ((int __fd, __const __ptr_t __buf, size_t __n));
extern ssize_t write __P ((int __fd, __const __ptr_t __buf, size_t __n));

I understand extern to allow globally declared stuff to not step on each other,
hence ssize_t is declared as a global in some other file, right? I'm confused
by how ssize_t is followed by a __write (or write) but then a space then __P
then double parentheses! What's going on here? I guess __P is the real write
function, embedded in the __write function? Also, what is the convention for
this double underscore stuff? And finally, where is the code where my write()
function actually gets done?

Hopefully somebody knows and maybe somebody can put me on the trail of a book,
etc. that will explain some of this blood and guts stuff.

Lars v.d. Ast


-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]