zapis do neotevreneho socketu

Michal Ludvig michal-linux na logix.cz
Středa Listopad 7 14:12:32 CET 2001


petr.adamek na antek.cz wrote:

> Nemam ted moznost vyzkouseni, proto se ptam zde: 
> jak se spravne chova unixovy system s BSD-
> kompatibilnimi sockety, kdyz provedu write(2) na 
> socket, ktery neni otevreny (tj. neprobehl 
> accept(2)/connect(2), pripadne ani bind(2))? Ja 
> bych cekal nejaky EBADF, ale HP-UX 10.20 mi 
> tvrdosijne vraci EPIPE (a posila signal 
> 13). Dela to spravne?


Ano, nejspis se chova spravne.
$ man 2 write
[...]
ERRORS
     EPIPE  fd is connected to a pipe or socket  whose  reading
            end  is closed.  When this happens the writing pro-
            cess will receive a SIGPIPE signal; if it  catches,
            blocks or ignores this the error EPIPE is returned.
[...]

Michal Ludvig
-- 
* Cray is the only computer that runs
*  an endless loop in just 4 hours.



Další informace o konferenci Linux