UNIX libraries in windows

A

anand.ba

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>


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


Thank you
 
C

Clever Monkey

I need to find equivalent windows libraries for the following unix
ones.

#include <sys/prctl.h>
#include <sys/ioctl.h>
#include <unistd.h>

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

This group is pretty strict about on-topic posts, and the headers you
refer to are not part of ISO C. I suspect you will have to find a more
appropriate forum for this question.

However, just FYI, there are many interoperability libraries that allow
fairly easy porting of Unix/POSIX apps to Win32. Immediate examples
that spring to mind are cygwin and the payware MKS Toolkit and
Nutcracker porting suite.
 
S

Simon Biber

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top