473,569 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6007
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 interoperabilit y 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
2710
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
4112
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
3417
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++ compiler. I need to compile it under UNIX platform. correct? any other alternatives?? Please advise. Thanks!!
3
4254
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 active? Can the setting of LD_LIBRARY_PATH guanrantee that the correct one is executed? 2> In MS-WINDOWS, once a DLL is loaded by one...
15
5860
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 to some good article to read up on this? Basically, I'm looking a possible project that has a Window client but needs to get information from...
36
3616
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 Unix, for example, open(), close(), read(), write(), lseek() ... Which set of functions is more suitable for I/O task, C library version or Unix...
7
1958
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. Whst is the difference between programming c++ on windows and unix. Which compiler one has to use on unix.
65
5036
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 got errors of Failed to open file ./outdir/mytestout.txt. Below is the code: #include <stdio.h>
223
7140
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 interprocess controls and communication, locale determination, EBCDIC/ASCII discrimination, etc. Almost all of these are easy in Perl. Why isn't there a...
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8125
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.