| Author |
UNIX libraries in windows
|
|
| anand.ba@gmail.com 2006-05-29, 7:06 pm |
| 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 of these libraries
Thank you
| |
| Erik de Castro Lopo 2006-05-29, 7:06 pm |
| anand.ba@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>
>
> Basically I need to use the sproc() function in sys/prctl.h.
That exact functionality is very *VERY* unlikely to exist
on windows. They may or may not be something similar with
a completely different API.
> The sys/ioctl.h
Again ioctls are a unix concept and don't exist on windows.
> and unistd.h
Much of the stuff in <unistd.h> does exist on windows and
some of it works very very badly. For instance windows
does have 64 bit offset version of open/read/write/ls
etc but they have seriously egregious bugs.
> libraries
These are not libraries they are header files defining
the workings of what is basically libc.
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
Everyone seems to assume that the current system in America is capitalism.
I beg to differ. True capitalism does not involve false advertising,
distribution cartels, or political lobbying for special advantages in the
market. How can you call Microsoft or the RIAA capitalist, when their main
business is interfering with a free market? Some of us would like to see a
*return* to capitalism in this country. - Jim Flynn on Linuxtoday.com
| |
| Michel Bardiaux 2006-05-30, 4:04 am |
| Erik de Castro Lopo wrote:
> anand.ba@gmail.com wrote:
>
> That exact functionality is very *VERY* unlikely to exist
> on windows. They may or may not be something similar with
> a completely different API.
ISTR the pthreads library exists for win32. The best strategy then would
be to convert the sproc calls to pthreads on unix first, then on win32
(rather than ifdef-ing to use sproc on unix and something else on win32).
>
>
> Again ioctls are a unix concept and don't exist on windows.
>
>
> Much of the stuff in <unistd.h> does exist on windows and
> some of it works very very badly. For instance windows
> does have 64 bit offset version of open/read/write/ls
> etc but they have seriously egregious bugs.
I'm interested, having just hit several largefile problems with our
applications. Details? (of both how to call them and what the known bugs
are!) TIA.
>
>
> These are not libraries they are header files defining
> the workings of what is basically libc.
>
> Erik
--
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux@mediaxim.be
Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/
| |
| Erik de Castro Lopo 2006-05-30, 8:03 am |
| Michel Bardiaux wrote:
>
> I'm interested, having just hit several largefile problems with our
> applications. Details? (of both how to call them and what the known bugs
> are!) TIA.
Grab the sources to libsndfile:
http://www.mega-nerd.com/libsndfile/#Download
In particular, the stuff that doesn't work is the 64 bit offset
versions of ls and fstat. The program tests/win32_test.c in
the tarball details this in all its glory. I've just tried this
on winxp and it works correctly. It failed on win98 and/or win2k.
In the end, the only way I could get correctly working large
file stuff working on windows was to wrap the native win32
API functions CreateFile/WriteFile/SetFilePointer to create
similar functoins to the POSIX ones. This is all in the file
src/file_io.c of the above tarball.
The Win32 API functions work, but should be used as prime
example of how not to design an API (likewise for the rest
of the win32 API).
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
A Microsoft Certified System Engineer is to computing what a
MacDonalds Certified Food Specialist is to fine cuisine.
| |
| anand.ba@gmail.com 2006-05-30, 7:07 pm |
| I forgot to mention that im using Microsoft VC++ as my compiler (yes i
have to use this...)
| |
| anand.ba@gmail.com 2006-05-30, 7:07 pm |
| >> The sys/ioctl.h
> Again ioctls are a unix concept and don't exist on windows.
Is there something similar that i can use in windows?
> Much of the stuff in <unistd.h> does exist on windows and
> some of it works very very badly. For instance windows
> does have 64 bit offset version of open/read/write/ls
> etc but they have seriously egregious bugs.
Are you referring to the winsock.h header?
| |
| Erik de Castro Lopo 2006-05-30, 7:07 pm |
| anand.ba@gmail.com wrote:
>
>
> Is there something similar that i can use in windows?
I don't believe that there is anything even remotely similar.
>
> Are you referring to the winsock.h header?
No.
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
"I have long argued that the entertainment industry doesn't want
people to have computers. Computers give users too much capability,
too much flexibility, too much freedom. The entertainment industry
wants users to sit back and consume things. They are trying to
turn a computer into an Internet Entertainment Platform, along the
lines of a television or VCR. This bill is a large step in that
direction." -- Bruce Schneier
| |
| Jim Cochrane 2006-05-30, 7:07 pm |
| On 2006-05-30, Erik de Castro Lopo <nospam@mega-nerd.com> wrote:
> anand.ba@gmail.com wrote:
>
> I don't believe that there is anything even remotely similar.
>
What about cygwin?
--
*** Posted via a free Usenet account from http://www.teranews.com ***
| |
| Erik de Castro Lopo 2006-05-31, 8:10 am |
| Jim Cochrane wrote:
>
> On 2006-05-30, Erik de Castro Lopo <nospam@mega-nerd.com> wrote:
>
> What about cygwin?
Ioctls are often incompatible across difference unices.
Cygwin probably does have some common icotls but is unlikely
to have all of the one you would expect on your unix of
choice.
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
"Attacks by Microsoft Chairman Bill Gates on the GNU General
Public License, under which much open source and free software is
distributed, have been driven by a fear that the GPL creates a
domain of software that Microsoft cannot privatize and control"
-- Richard Stallman
|
|
|
|