From: Benjamin R. <Ben...@ep...> - 2003-05-25 14:50:34
|
Hi Liu, LiuKai <sho...@ya...> writes: > But the glibc provides the syscall(), why the not in mingw? As I explained, syscall() is a Linux feature. Windows doesn't have it and doesn't need it. Mingw uses the Microsoft runtime (not glibc) to provide the C runtime functions. In addition to the C runtime functions (like fopen()), the Microsoft runtime also includes some selected POSIX functions like open(), as a convenience for developers. > How can I implement open() without syscall() to make the system > call? On Linux you use Linux APIs, on Windows you use Windows APIs. The Windows APIs are documented in the so-called "Platform SDK" which is available on Microsofts MSDN site <URL:http://msdn.microsoft.com> as a download and also as online documentation. The function that you are looking for in this case is CreateFile(). Unless this is just an exercise for you, you may want to explain why you want to re-implement a functions that is not trivial to write and where several implmentation already exist and come with every compiler. Maybe somebody can suggest a better solution. But than that discussion should probably be on some C language beginners' forum, not here, where it's slightly off topic. so long, benny |