Hi all
I need to find equivalent windows libraries for the following unix
ones.
#include <sys/prctl.h>
#include <sys/ioctl.h>
#include <unistd.h>
These are NOT libraries! They are header files. Please, please learn the
difference. It is very important. On Unix systems most of the system
calls are implemented in the C library, libc.
On Windows, you can generally use Unix emulation systems such as Cygwin.
Most of the Unix/Posix functions are implemented by Cygwin.
Basically I need to use the sproc() function in sys/prctl.h. The
sys/ioctl.h and unistd.h libraries are very necessary though. Are
there any windows versions or acceptable conversion functions of these
libraries
Unfortunately sproc is not a Posix function. It's specific to SGI IRIX.
It is not implemented by Cygwin.
Quoting from the man page:
The sproc and sprocsp system calls are a variant of the standard
fork(2) call. Like fork, the sproc calls create a new process that
is a clone of the calling process. The difference is that after an
sproc call, the new child process shares the virtual address space
of the parent process (assuming that this sharing option is
selected, as described below), rather than simply being a copy of
the parent. The parent and the child each have their own program
counter value and stack pointer, but all the text and data space is
visible to both processes. This provides one of the basic
mechanisms upon which parallel programs can be built.
This description sounds like what is called "threads" on other systems.
It may be possible to port your program to use Posix threads, which are
supported by Cygwin.
Quoting from another web site:
VR Juggler supports the use of either POSIX threads (pthreads) or
SPROC threads on IRIX. We distribute two versions of each VR Juggler
release: one compiled to use pthreads and the other to use SPROC.
The two versions are 100% incompatible, meaning that you cannot mix
pthreads-based software with SPROC-based software. Simply having
-lpthread on the link line with a SPROC-based application is
sufficient to cause this exit behavior, even if no pthreads calls
are made anywhere in your code or in the code on which you depend.
Porting your program to pthreads will not just allow you to run it on
Windows but on all other forms of Unix.