Sponsored Content
Top Forums UNIX for Advanced & Expert Users how to differentiate system call from library call Post 302127855 by blowtorch on Thursday 19th of July 2007 10:22:24 PM
Old 07-19-2007
Check the man page. For chmod it will be something like chmod(2). Your OS will have specific sections of the man pages dedicated to things like system calls, user commands, admin commands, files and so on. The (2) usually means system call on most systems. Now check the man page for something else like fprintf. You will see either fprintf(3C) or fprintf(3). On most systems, section 3/3C is for library functions.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

tcsh user failed to call library in ksh program

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

c system call

How the c compiler differentiates the system calls and function calls? (1 Reply)
Discussion started by: rangaswamy
1 Replies

3. Shell Programming and Scripting

How to call the c library created by shc

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

How to call the c library created by shc

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

diffrence between method call and function call in perl

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

system call

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

C:system call

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

system call

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

need help with system call

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

system call

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
explain_chmod(3)					     Library Functions Manual						  explain_chmod(3)

NAME
explain_chmod - explain chmod(2) errors SYNOPSIS
#include <libexplain/chmod.h> const char *explain_chmod(const char *pathname, int mode); const char *explain_errno_chmod(int errnum, const char *pathname, int mode); void explain_message_chmod(char *message, int message_size, const char *pathname, int mode); void explain_message_errno_chmod(char *message, int message_size, int errnum, const char *pathname, int mode); DESCRIPTION
These functions may be used to otain explanations for chmod(2) errors. explain_chmod const char *explain_chmod(const char *pathname, int mode); The explain_chmod function is used to obtain an explanation of an error returned by the chmod(2) system call. The least the message will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: if (chmod(pathname, mode) < 0) { fprintf(stderr, '%s0, explain_chmod(pathname, mode)); exit(EXIT_FAILURE); } pathname The original pathname, exactly as passed to the chmod(2) system call. mode The original mode, exactly as passed to the chmod(2) system call. Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_errno_chmod const char *explain_errno_chmod(int errnum, const char *pathname, int mode); The explain_errno_chmod function is used to obtain an explanation of an error returned by the chmod(2) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: if (chmod(pathname) < 0) { int err = errno; fprintf(stderr, '%s0, explain_errno_chmod(err, pathname)); exit(EXIT_FAILURE); } errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. pathname The original pathname, exactly as passed to the chmod(2) system call. mode The original mode, exactly as passed to the chmod(2) system call. Returns: The message explaining the error. This message buffer is shared by all libexplain functions which do not supply a buffer in their argument list. This will be overwritten by the next call to any libexplain function which shares this buffer, including other threads. Note: This function is not thread safe, because it shares a return buffer across all threads, and many other functions in this library. explain_message_chmod void explain_message_chmod(char *message, int message_size, const char *pathname, int mode); The explain_message_chmod function is used to obtain an explanation of an error returned by the chmod(2) system call. The least the mes- sage will contain is the value of strerror(errno), but usually it will do much better, and indicate the underlying cause in more detail. The errno global variable will be used to obtain the error value to be decoded. This function is intended to be used in a fashion similar to the following example: if (chmod(pathname, mode) < 0) { char message[3000]; explain_message_chmod(message, sizeof(message), pathname, mode); fprintf(stderr, '%s0, message); exit(EXIT_FAILURE); } message The location in which to store the returned message. Because a message return buffer has been supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. pathname The original pathname, exactly as passed to the chmod(2) system call. mode The original mode, exactly as passed to the chmod(2) system call. explain_message_errno_chmod void explain_message_errno_chmod(char * message, int message_size, int errnum, const char *pathname, int mode); The explain_message_errno_chmod function is used to obtain an explanation of an error returned by the chmod(2) system call. The least the message will contain is the value of strerror(errnum), but usually it will do much better, and indicate the underlying cause in more detail. This function is intended to be used in a fashion similar to the following example: if (chmod(pathname) < 0) { int err = errno; char message[3000]; explain_message_errno_chmod(message, sizeof(message), err, pathname); fprintf(stderr, '%s0, message); exit(EXIT_FAILURE); } message The location in which to store the returned message. Because a message return buffer has been supplied, this function is thread safe. message_size The size in bytes of the location in which to store the returned message. errnum The error value to be decoded, usually obtained from the errno global variable just before this function is called. This is neces- sary if you need to call any code between the system call to be explained and this function, because many libc functions will alter the value of errno. pathname The original pathname, exactly as passed to the chmod(2) system call. mode The original mode, exactly as passed to the chmod(2) system call. COPYRIGHT
libexplain version 0.52 Copyright (C) 2008 Peter Miller AUTHOR
Written by Peter Miller <pmiller@opensource.org.au> explain_chmod(3)
All times are GMT -4. The time now is 05:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy