473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

UNIX libraries in windows

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

May 29 '06 #1
2 5976
an******@gmail.com wrote:
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.
May 29 '06 #2
an******@gmail.com wrote:
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.

--
Simon.
Jun 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Alex | last post by:
I've just noticed that directories in Unix have different sizes whereas in Windows they don't. Why is this so? Thanks. Alex.
6
by: Matthew | last post by:
How would I go about creating a simple "hello world" program that will run in Unix. I am using MS Visual C++.
12
by: jrefactors | last post by:
If the C programs have UNIX system calls such as fork(), alarm(), etc.., we should call it UNIX programs, not traditional C programs? We couldn't compile the programs with system calls using VC++...
3
by: K.S.Liang | last post by:
Hi all, 1> If there are more than one dynamic linking libraries in the file system, how do I know which one is loaded into system? Any C library or system call can tell me which *.so or *.sl is...
15
by: Alpha | last post by:
I was told that Unix API can only be called using C++, ATL and MFC. However, I was also told that C# can do that through Pinvoke to a DLL that interfaces with the Unix API. Can someone direct me...
36
by: lovecreatesbeauty | last post by:
In the C programming language, I/O operation functions are declared in stdio.h, for example, fopen(), fclose(), fwrite(), fread(), fseek() ... But another set of I/O functions are also defined in...
7
by: yang__lee | last post by:
Hi, I have been programming c, c++ on windows. What is the difference in programming on Unix.. are there different syntaxes, functions on Unix. what are mandatory different steps on unix....
65
by: Hongyu | last post by:
Dear all: I am trying to write to a file with full directory name and file name specified (./outdir/mytestout.txt where . is the current directory) in C programming language and under Unix, but...
223
by: Pilcrow | last post by:
Given that UNIX, including networking, is almost entirely coded in C, how come so many things are almost impossible in ordinary C? Examples: Network and internet access, access to UNIX...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.