Sponsored Content
Full Discussion: System call source code
Top Forums Programming System call source code Post 302191280 by ramkrix on Friday 2nd of May 2008 05:56:05 AM
Old 05-02-2008
Question System call source code

Hi,

1. Can anybode suggest me where to find the source code for system calls itself? Like open(), read(), close(). May I have the link or book where I can find the source code these functions itself?

2. When ever we quit a file or save and quit a file, the file content is stored in the disk. Internally, after putting the contents on the disk the kernal calls close() system call to close/quit the file. Am I right with what I said? please tell the alternative answer for what is happening inside on closing/quitting a file, if mine is wrong?
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 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. UNIX for Dummies Questions & Answers

System call code - nice()

Hi there, i'm trying to find the implementation code for the system call nice(). Since it's a system call i'm having problems finding where it would be? is it in the linux kernel directory somewhere? I would assume it would be a file called nice.c or something like this. Thanks in advance! (2 Replies)
Discussion started by: sport23
2 Replies

4. 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

5. 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

6. 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

7. Shell Programming and Scripting

UNIX/Perl script to call informatica source counts

Hi Guys, I am trying below condition . We are using Informatica 9.5 and scheduling certain informatica mapping on set timings .But we are not sure whether the database source table are latest or not .Since its gets updated on daily basis and not sure when it completes.Can we write any unix/perl... (1 Reply)
Discussion started by: Perlbaby
1 Replies
CLOSE(2)						     Linux Programmer's Manual							  CLOSE(2)

NAME
close - close a file descriptor SYNOPSIS
#include <unistd.h> int close(int fd); DESCRIPTION
close() closes a file descriptor, so that it no longer refers to any file and may be reused. Any record locks (see fcntl(2)) held on the file it was associated with, and owned by the process, are removed (regardless of the file descriptor that was used to obtain the lock). If fd is the last file descriptor referring to the underlying open file description (see open(2)), the resources associated with the open file description are freed; if the descriptor was the last reference to a file which has been removed using unlink(2) the file is deleted. RETURN VALUE
close() returns zero on success. On error, -1 is returned, and errno is set appropriately. ERRORS
EBADF fd isn't a valid open file descriptor. EINTR The close() call was interrupted by a signal; see signal(7). EIO An I/O error occurred. CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001. NOTES
Not checking the return value of close() is a common but nevertheless serious programming error. It is quite possible that errors on a previous write(2) operation are first reported at the final close(). Not checking the return value when closing the file may lead to silent loss of data. This can especially be observed with NFS and with disk quota. A successful close does not guarantee that the data has been successfully saved to disk, as the kernel defers writes. It is not common for a file system to flush the buffers when the stream is closed. If you need to be sure that the data is physically stored use fsync(2). (It will depend on the disk hardware at this point.) It is probably unwise to close file descriptors while they may be in use by system calls in other threads in the same process. Since a file descriptor may be reused, there are some obscure race conditions that may cause unintended side effects. SEE ALSO
fcntl(2), fsync(2), open(2), shutdown(2), unlink(2), fclose(3) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2007-12-28 CLOSE(2)
All times are GMT -4. The time now is 12:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy