LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   modifying system calls (https://www.linuxquestions.org/questions/linux-newbie-8/modifying-system-calls-380508/)

manjiri 11-06-2005 12:21 PM

modifying system calls
 
i just wanted to know can we make some change in system call used to open a file. i.e how it searches for contents of file. i.e when we try to open a file in any editor what actions are actually taken.

foo_bar_foo 11-06-2005 12:53 PM

well when you open a file you just give it argument of file path name in the form of a character string and a flag for truncate, append, create. returned you get a file descripter and you can do anything you like with it. File descripters remember their place in the file but there is a call lseek you can use to jump around to positions off_t offset from the beginning if you like.

you mention editor.
editors can use a variety of wrapped methods like from a toolkit or something to access a file or can use syscalls directly.

manjiri 11-07-2005 10:12 AM

thanx can u pl tell me which files are actually loaded when i type vi on the command prompt

foo_bar_foo 11-07-2005 01:02 PM

Quote:

Originally posted by manjiri
thanx can u pl tell me which files are actually loaded when i type vi on the command prompt
that would be the executable file vi
most likely /usr/bin/vi


All times are GMT -5. The time now is 12:28 PM.