Mail Archives: djgpp-workers/2003/01/07/19:31:46
"Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk> said:
> The code for FSEXT and fd_props in is in src/libc/fsext and src/libc/dos/io.
> There's not much of it and it's worth reading. You should be able to use
> fd_props for FSEXT-allocated handles. You may want to ensure that no
> filesystem functions end up handling your file descriptor, though, by making
> the FSEXT handler function just fail for any functions you're not hooking.
I do that except when the fd isn't a socket or creat() or an unknown __FSEXT_xx
func was called.
> > Can it be used (or extended) to make some sort of virtual dir-list of
> > "/dev/socket/"?
>
> You can support /dev/socket/* by adding an FSEXT open handler. See:
>
> info libc alpha __FSEXT_add_open_handler
Was just a thought for something cool things to do with the new functions
in 2.04. I really don't need such functionallity since socket() creates the
fd.
> If you have a copy of DJGPP CVS (what will become 2.04 someday), take a look
> at the code to support /dev/zero and /dev/full in src/libc/fsext/fse_zero.c.
> This copes with multiple references to /dev/zero and /dev/full. Maybe this
> will help.
Thanks alot. I'll have a look.
> I'd decrease the reference count in the per-socket block. If the count reaches
> zero, do the socket clean-up.
That's excactly what I'm doing now.
> I don't think FILE_DESC_TEMPORARY does what you want either. This is for
> removing physical files on close. OTOH if you have a remove handler for the
> socket, you can do what you want. (close will call remove for file descriptors
> with FILE_DESC_TEMPORARY set in fd_props.)
>
> Hope that helps.
Thanks for the consise explanation.
BTW. I became aware of Salford C/C++ today. Look at what amasing runtime
checks can be done with this compiler. Have a look this folks:
http://www.polyhedron.co.uk/salford/whitepapers/check.html
The DOSX version is shelved some years ago. I'm in contact with them for
releasing it as freeware. Another port for Watt-32...
Gisle V.
# echo 'GET /laid HTTP/1.0' | /bin/nc www.hotsluts.com 80
/bin/nc: Host is down (EHOSTDOWN)
- Raw text -