07-20-2007
Quote:
Originally Posted by
muru
How do I differentiate system call from library call?
Look in "/usr/include/sys/syscall.h" or equivalent for a macro identifying an index for that call
Quote:
Originally Posted by
muru
for example if I am using chmod , how do I find out if it is a system call or library call?
You may not be able to as you link with libc.a (or similar) and that provides the calls, these may be a full implementation or a wrapper around the actual system call.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi folks,
I'm trying to organize functions in my ksh program into libraries.
If I run my program as any ksh user it will succeed.
Only when I run my program as tcsh user (i.e oracle) I failed.
Example
=======
The ksh code:
tornado:/tmp # cat nir.ksh
#! /bin/ksh
cdromPath=`pwd`... (1 Reply)
Discussion started by: nir_s
1 Replies
2. Programming
How the c compiler differentiates the system calls and function calls? (1 Reply)
Discussion started by: rangaswamy
1 Replies
3. Shell Programming and Scripting
I have written a shell script called square, which prints the square of the input number, eg.
> square 4
16
There is a program called shc which compiles the shell scirpt and create a executable file and a c library file, namely square.x and square.x.c repectively.
If I would like to... (0 Replies)
Discussion started by: alfredo
0 Replies
4. Programming
I have written a shell script called square, which prints the square of the input number, eg.
> square 4
16
There is a program called shc which compiles the shell scirpt and create a executable file and a c library file, namely square.x and square.x.c repectively.
If I would like to... (1 Reply)
Discussion started by: alfredo
1 Replies
5. Infrastructure Monitoring
Hello,
I have a problem with package and name space.
require "/Mehran/DSGateEngineLib/general.pl";
use strict;
sub System_Status_Main_Service_Status_Intrusion_Prevention
{
my %idpstatus;
my @result;
&General_ReadHash("/var/dsg/idp/settings",\%idpstatus);
#print... (4 Replies)
Discussion started by: Zaxon
4 Replies
6. Shell Programming and Scripting
Hi,
How to write a system calls in a script ?
> cd $HOME
> ls -ltr
thanks in advance.. (10 Replies)
Discussion started by: hegdeshashi
10 Replies
7. Programming
Hi
I'm studing the system call. I've written a small program that return the time spent in doing some operations. Now I'd like to write one that return the time spent in user mode of a process.
I'm reading that i should use the tms struct:
clock_t times(struct tms *buf);
struct tms {... (2 Replies)
Discussion started by: Dedalus
2 Replies
8. Programming
I have a cgi script which is called after certain time interval, which has this:
system ("ls -l /tmp/cgic* | grep -v \"cgicsave.env\" | awk '{print $5}'");
During the execution of this script,the output is 0 sometimes. But due to this the system call is not working at all and doesnt o/p... (2 Replies)
Discussion started by: xs2punit
2 Replies
9. Programming
hi everyone
i wrote a system call and compiled the kernel succesfully...
my system call is in a file in the kernel folder named my_syscall1.c (kernel/my_syscall1.c)
the header file for this system call i added it in the folder include like this include/my_syscall1/my_syscall1.h
my problem is... (2 Replies)
Discussion started by: demis87
2 Replies
10. Shell Programming and Scripting
Trying to figure out a load issue with a webserver. I have traced a php script and noticed the following
connect(4, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("XX.XX.XX.XX")}, 16) = -1 EINPROGRESS (Operation now in progress) <0.000035>
poll(, 1, 2000) = 1 () <0.000120>... (5 Replies)
Discussion started by: rajan007
5 Replies
LEARN ABOUT XFREE86
syscall
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)