SYSCALL(2) BSD System Calls Manual SYSCALL(2)NAME
syscall, __syscall -- indirect system call
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/syscall.h>
#include <unistd.h>
int
syscall(int number, ...);
off_t
__syscall(quad_t number, ...);
DESCRIPTION
The syscall() function performs the system call whose assembly language interface has the specified number with the specified arguments.
Symbolic constants for system calls can be found in the header file <sys/syscall.h>. The __syscall() form should be used when one or more of
the arguments is a 64-bit argument to ensure that argument alignment is correct. This system call is useful for testing new system calls
that do not have entries in the C library.
RETURN VALUES
The return values are defined by the system call being invoked. In general, a 0 return value indicates success. A -1 return value indicates
an error, and an error code is stored in errno.
HISTORY
The syscall() function appeared in 4.0BSD.
BUGS
There is no way to simulate system calls that have multiple return values such as pipe(2).
BSD June 16, 1993 BSD
Check Out this Related Man Page
syscall(3UCB) SunOS/BSD Compatibility Library Functions syscall(3UCB)NAME
syscall - indirect system call
SYNOPSIS
/usr/ucb/cc [ flag ... ] file ...
#include <sys/syscall.h>
int syscall(number, arg, ...);
DESCRIPTION
syscall() performs the function whose assembly language interface has the specified number, and arguments arg .... Symbolic constants for
functions can be found in the header <sys/syscall.h>.
RETURN VALUES
On error syscall() returns -1 and sets the external variable errno (see intro(2)).
FILES
<sys/syscall.h>
SEE ALSO intro(2), pipe(2)NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system
libraries or in multi-thread applications is unsupported.
WARNINGS
There is no way to use syscall() to call functions such as pipe(2) which return values that do not fit into one hardware register.
Since many system calls are implemented as library wrappers around traps to the kernel, these calls may not behave as documented when
called from syscall(), which bypasses these wrappers. For these reasons, using syscall() is not recommended.
SunOS 5.10 22 Jan 1993 syscall(3UCB)
I have a question regarding the recv syscall.
Suppose I have a client/server and the following exchange of message took place:
Client --> Server using multiple send syscalls one after another immediately:
send "Packet1"
send "Packet2"
send "Packet3"
Server receives in the... (2 Replies)
Hello, I have problems finding clear information about the use of select(). I want to write an application, and for that I need to be sure about the functions behaviour. So to ensure, that I understood it all correctly I make some statements or questions. So a qualified answer could just be: yes,... (13 Replies)
Hi all,
i just started started learning system programming and want to pursue a career in the sys prog area.
below is the program that use a fork() call.
i read in one of the tutorials that parent process and child process uses different address spaces and runs concurrently.
that meas each... (2 Replies)
Hi all,
I am using ptrace to keep track of clone syscalls in a program. However, I found that the traced syscall cant be paired. for example, there are some syscalls that have entry, but without exit showing up in the traced sequences. So, is there anyway to distinguish the entry and exit of a... (0 Replies)
This is the gdb backtrace.
^C
Program received signal SIGINT, Interrupt.
0xffffe424 in __kernel_vsyscall ()
(gdb) bt
#0 0xffffe424 in __kernel_vsyscall ()
#1 0xb7e56a70 in __nanosleep_nocancel () from /lib/libc.so.6
#2 0xb7e568bb in __sleep (seconds=0) at sleep.c:138
#3 0x080496d5 in... (6 Replies)
I'm trying to compile a program called varkon, but after I chose an option from the main screen it gives me a segfault. The code is to long for me to go through it all, so I tried using gdb.
This was the output:
Reading symbols from /home/oliverj/Downloads/varkon/bin/xvarkon...(no debugging... (5 Replies)
I saw somewhere that describe read() as a primitive. But when I lean signals, it says the read() may be interrupted by a signal.
My Question:
1, What is the diffence between primitive and reentrant?
2, Is read() a primitive or reentrant?
3, Are all system calls primitive or reentrant? (2 Replies)
We have just enabled core dump on our RHEL5.7 OS. the java process is terminating very often so we enable core dump to analysis the issue and find below in core dump file.
Core was generated by `/usr/java/jdk1.6.0_06//bin/java -server -Xms1536m -Xmx1536m -Xmn576m -XX:+Aggre'.
Program... (0 Replies)
Hello Experts,
If a Solaris process is calling some syscall, and right now execution is inside syscall doing only CPU work, for example the inside simplest times syscall,
-> app_func
=> times
<< we are here now, we have entered in the times, but not exited yet
<= times
<- app_func... (9 Replies)
Hi,
I wanna add my own system call to Fedora 18 kernel 3.8.2.
From kernel 3.3 I heard there is a new system to add system calls.
So where i can find a guides ?
I wanna print this text: "Hello world!" in terminal, not dmesg. (4 Replies)
Hello to all
I want download a file in osx intel 64 with NASM , I want to use socket syscall
This is part of my code
section .data
command db "GET /test/2.gif HTTP/1.1\r\nHost: 10.1.1.187\r\n\r\n", 0
; url db "http://172.16.207.153/test/2.gif", 0
global main... (1 Reply)
When I use this command:
purify gcc -g hello_world.c
to instrument a C program with Purify, I get this error :
Purify engine:Error: The /usr/lib/syscalls.imp file either does not exist or has incorrect permissions.You may need to install bos.adt.syscalls
I understand that I need to install... (11 Replies)
I am getting SSL_ERROR_SYSCALL in connection to qa-api.ncl.com:443. Please help me on this. But I am able to get response in Soap UI.
Please use CODE tags when displaying sample input, output, and code segments. (13 Replies)