Calling system calls in C runtime (in the run-time)
I know there is a way to call winapi in runtime in windows. I want to ask how can I call a system call in gcc in runtime (when I don't know what it can be)?
I don't mean syscall that I think is for calling only system calls and not library functions. Thanks! |
what's syscall of linux's equivalence in freebsd? Though it is only for kernel system calls. Calling system calls is with int 80 in asm, how is it for the (static and shared) library functions? How do they work?
|
Hi -
The "moral equivalent" to the Win32 API for Linux is "glibc", the Gnu C runtime library. Standard library calls like "open()" and "fork()" are thin wrappers around the actual system calls (for example, "asm int 80" for some kernels). You can learn more about "how it works" here: http://www.gnu.org/software/libc/man...l#System-Calls You can get complete source and study it yourself here: http://www.gnu.org/software/libc/ 'Hope that helps |
This is the way it was on a linux box about 5 years ago. I don't think it changed much. I would think it should work the same assuming you are using cygwin.
std::string moveAFile = "mv test1 test2"; int check = system(moveAFile.c_str()); Best of luck, Mike |
Quote:
|
All times are GMT -5. The time now is 12:18 PM. |