Can MinGW replicate most unix system calls with no effort?

codechao

Background: I'm working on porting a large project that was developed in C++ exclusively for unix systems, to be compatible with windows to make way for an eventual windows distribution. I don't have very much experience in Windows development, but I'd like to get whatever I can do, done right, before senior developers move in and take over.

Question: So for a while, I've been looking up Windows versions for all the unix/posix calls that are used in the software, most coming from dirent.h, unistd.h, and some ones under sys, like sys/stat.h or sys/types.h. And although it'll take a lot of work to modify the programs to adopt the new Win32 API calling conventions and return types (and sometimes all new functions), it'll probably work, eventually.

But I've been seeing this come up frequently, the fact that MinGW, I guess, includes many native unix calls and functionalities as part of the GCC environment, and can translate them into windows-compatible calls so you can compile on Windows, and use said compiled program on Windows easily. In fact, one of the similar questions I read in the sidebar talks about just that. What I don't understand, and seem to have trouble understanding, is exactly the extent of this built-in translation functionality, and where I can find a list of system stuff that'll work with this.

Sorry this post is a little unstructured and that I'm so green with this, but I only have 2 weeks to try to accomplish something with this before I get swapped with a senior developer.

user253751

No. MinGW does not attempt to implement UNIX functions on Windows. It cannot replicate most system calls with no effort.

However, Cygwin does do that.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Implicit system calls in UNIX commands

From Dev

How to list system calls and library calls in Unix?

From Dev

Can system calls be interrupted?

From Dev

Unix system calls : read/write and the buffer

From Dev

Why is the most powerful user on a Unix/Linux system called “root?”

From Dev

What does the (2) after Unix system calls names mean?

From Dev

Can I use Linux system calls in android?

From Dev

How mingw32-g++ compiler know where to inject system calls in the WIN32 machine executable?

From Dev

Can systemd and upstart coexist together on a Unix system?

From Dev

Unix alternative to this mingw runtime code

From Dev

Replicate Curl unix-socket command in Java

From Dev

how to print first 10 lines of a text file using Unix system calls?

From Java

What are the calling conventions for UNIX & Linux system calls on i386 and x86-64

From Dev

Basics questions regarding File and I/O System Calls in C (on Linux/UNIX)

From Dev

How can you find out which registers are used for system calls?

From Dev

Can you perform system calls from OSX Terminal?

From Java

How can I tell who calls System.gc()?

From Dev

How can I find the implementations of Linux kernel system calls?

From Dev

Can we do dynamic memory allocation, without system calls?

From Dev

Can you hook into system function calls in iOS using private APIs?

From Dev

host can choose which system calls pass to each webassembly module

From Dev

Which exactly are the system calls we can run via /bin/sh?

From Dev

exec() and system() system calls

From Dev

Can't replicate hashing of string

From Dev

can I build python in unix if i'm not a system administrator?

From Dev

Can the Unix/Linux shell be considered an Operating System in addition to a programming language?

From Dev

How can I click missed calls icon to open system Missed Calls UI?

From Dev

In async Rust, how can a Future make sure it only calls the most recent Waker?

From Dev

GCC (MinGW) and WINAPI calls on Windows 32 bits

Related Related

  1. 1

    Implicit system calls in UNIX commands

  2. 2

    How to list system calls and library calls in Unix?

  3. 3

    Can system calls be interrupted?

  4. 4

    Unix system calls : read/write and the buffer

  5. 5

    Why is the most powerful user on a Unix/Linux system called “root?”

  6. 6

    What does the (2) after Unix system calls names mean?

  7. 7

    Can I use Linux system calls in android?

  8. 8

    How mingw32-g++ compiler know where to inject system calls in the WIN32 machine executable?

  9. 9

    Can systemd and upstart coexist together on a Unix system?

  10. 10

    Unix alternative to this mingw runtime code

  11. 11

    Replicate Curl unix-socket command in Java

  12. 12

    how to print first 10 lines of a text file using Unix system calls?

  13. 13

    What are the calling conventions for UNIX & Linux system calls on i386 and x86-64

  14. 14

    Basics questions regarding File and I/O System Calls in C (on Linux/UNIX)

  15. 15

    How can you find out which registers are used for system calls?

  16. 16

    Can you perform system calls from OSX Terminal?

  17. 17

    How can I tell who calls System.gc()?

  18. 18

    How can I find the implementations of Linux kernel system calls?

  19. 19

    Can we do dynamic memory allocation, without system calls?

  20. 20

    Can you hook into system function calls in iOS using private APIs?

  21. 21

    host can choose which system calls pass to each webassembly module

  22. 22

    Which exactly are the system calls we can run via /bin/sh?

  23. 23

    exec() and system() system calls

  24. 24

    Can't replicate hashing of string

  25. 25

    can I build python in unix if i'm not a system administrator?

  26. 26

    Can the Unix/Linux shell be considered an Operating System in addition to a programming language?

  27. 27

    How can I click missed calls icon to open system Missed Calls UI?

  28. 28

    In async Rust, how can a Future make sure it only calls the most recent Waker?

  29. 29

    GCC (MinGW) and WINAPI calls on Windows 32 bits

HotTag

Archive