Mail Archives: djgpp-workers/1999/07/08/02:54:07
On Wed, 7 Jul 1999, Alain Magloire wrote:
> So programmers
> usually use fstat(socketfd, &buf_stat) and passing the result of
> st_mode from the struct stat to S_ISSOCK().
Where does the handle for sockets come from? Is it created using
FSEXT? If so, the current `fstat' is okay as long as libsocket isn't
linked in, since `fstat' will never set the S_IFSOCK bits on any
handle. We only need to update `fstat' when libsocket is linked into
a program.
> if you don't use libsocket or a socket library that doesn't catch the call
> in FSEXT_fstat it should technically fail i.e fstat() != 0
No, it won't fail, since the handle is created by FSEXT and is
connected to the null device, as far as DOS is concerned. So `fstat'
will succeed and return info for the null device. The socket support
will not work, of course, but otherwise I don't think this is too bad.
> This can be a problem if you use a socket lib with DJGPP that has a
> BSD socket API but no support for FSEXT_fstat. And If I understand,
> support for fstat in FSEXT was added only in 2.02.
Yes, __FSEXT_fstat was introduced in v2.02. But I don't see a problem
here, since libsocket can require v2.02 or later.
> BTW, is there a branch for 2.04 so we could start adding features
> snprintf, getconf, etc .. and break the world ?
I don't think there's a branch, and I don't think creating one is
worth the hassle. DJ?
Anyway, the original intent was to get v2.03 out the door quickly
enough to eliminate the need for branching. Obviously, I failed in
making that happen...
- Raw text -