In article <[log in to unmask]>, George <[log in to unmask]>
writes:
> <fcntl.h> doesn't seem to define fcntl()...nor does <sys/fcntl.h>
>
> Specifically I need it for this function:
> void nonblock(socket_t s)
> {
> int flags;
>
> flags = fcntl(s, F_GETFL, 0);
> flags |= O_NONBLOCK;
> if (fcntl(s, F_SETFL, flags) < 0) {
> perror("Fatal error executing nonblock (comm.c)");
> exit(1);
> }
> }
Be careful with this. Under Unix, sockets and file descriptors can be used
interchangably. This is not the case with our TCP/IP stack on VMS
(although other stacks allow this). If you need this feature, contact me
directly and I'll see what I can do.
> What is the correct way to make a socket non-blocking? (If no way I'll use
> my current work-around #define POSIX_NONBLOCKING_BROKEN)
To make a socket non-blocking, you need to call the socket_ioctl() function
with the FIONBIO option. Specifically, here's an example:
unsigned int enable=1;
status = socket_ioctl(socket, FIONBIO, &enable);
> And also, where is gettimeofday()? Not <sys/time.h>, <time.h>...
> I've cheated by prototyping it at 'int gettimeofday()' but as I have not
> linked it yet I do not know it it will work.
The gettimeofday() function is not implemented in our current version of
the C compiler. It is implemented in a new version of the C compiler that
I have planned to install this summer. Contact me directly for more
information about getting to this version for testing.
> PS - Pico always says it can unjustify after doing a search. The
> search options for UNIX include ^Y and ^V to go to the top and bottom of
> the file respectively, which Pico on the VAX doesn't.
I don't think I can help you there.
> (I also hate typing
> 'ls' and getting an editor, but that's OS differences) :)
You can get around this somewhat by adding the following line to your
LOGIN.COM file:
$ LS :== DIR
That will create a new "command" called LS that issues the DIR command.
--
Kent Covert, Software Coordinator
Miami Computing and Information Services
Miami University, Oxford, OH
[log in to unmask]
|