ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How system call internals could be known ? I mean for example if i take the example of write system call of linux kernel, where i can find out the code of write() system call in the kernel source tree ? The problem is write() system call directly write on console.If we want to write the data on some web page then write() system call will not do that ? How to redirect out data from console to application like html/web pages ? Can
anybody suggest something in this direction ?
write() attempts to write to a file descriptor of your choice. If you desire to write() to a HTML page, you can very well do that. You just have to open() the file first and close() the file afterwords.
As you already noticed, the write(2) system call isn't named that way in the kernel, it is named sys_write (take a look here: http://lxr.linux.no/#linux+v2.6.33/i...yscalls.h#L584). Like Sergei already said, the implementation of the write(2) function is in libc and it's basically a stub for the real system call sys_write and encapsulates the logic to do the system call in assembly (e.g. via int $80 or sysenter on x86 compatible platforms).
Thanks for reply.Can you please elaborate on it ? I mean how the file for a html be made ?If we are downloading a page from server, and want to put some let say login password information , how and what kind of file you are asking ?My main problem is , how to redirect from console to web page ? A System is wrting on console, and i want on html page!!!
Thanks for reply.Can you please elaborate on it ? I mean how the file for a html be made ?If we are downloading a page from server, and want to put some let say login password information , how and what kind of file you are asking ?My main problem is , how to redirect from console to web page ? A System is wrting on console, and i want on html page!!!
It's difficult to understand exactly what you need. I'm guessing that you're trying to send data to a HTTP server or somesuch (i.e. have a program access some username/password protected resource - perhaps a brute force kind of thing?). If this is the case, write() can help you, but you'll be writing to a socket. I suppose you could start with some books on network programming (i.e. UNIX Network Programming by Richard Stevens) or some guides on this topic (i.e. Beej's).
However, it seems you are too young a programmer to have a basic knowledge of the C programming language, and you don't seem to understand how "HTML pages" work. To make a long story short: this project seems out of your league, and no easy answer to your real query can be given. The question as depicted in the thread's title has been answered (more than once, I believe).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.