Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Installation - Getting started with Red Hat Linux
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
implementation of recv() and send()

implementation of recv() and send()

2004-06-15       - By Tsakiridis Antonis

 Back
Reply:     1     2  

On Tue, 15 Jun 2004 20:25:00 +0530 (IST), K S SUNDEEP REDDY
<sundeep@(protected)> wrote:

As far as the location of recv() and send() is concerned, I guess you 'll
have to do some more searching since I do not remember....

For the second matter:

When kernel code is executed as part of a user space process, the task
struct of the current process is pointed by
the "current" pointer. Hence, you can access the current processes id from
your module like this:

current->pid


Below, I attach an excerpt from the book "Linux Device Drivers, 2nd
Edition", By Alessandro Rubini & Jonathan Corbet :

{
The Current Process

Although kernel modules don't execute sequentially as applications do,
most actions performed by the kernel are related to a specific process.
Kernel code can know the current process driving it by accessing the
global item current, a pointer to struct task_struct, which as of version
2.4 of the kernel is declared in <asm/current.h>, included by
<linux/sched.h>. The current pointer refers to the user process currently
executing. During the execution of a system call, such as open or read,
the current process is the one that invoked the call. Kernel code can use
process-specific information by using current, if it needs to do so. An
example of this technique is presented in "Access Control on a Device
File", in Chapter 5, "Enhanced Char Driver Operations".
}

By the way, this book is great and most of all FREE!


I think you 'd get more answers in matters like these in lower lever
mailing-lists, although I have none to propose...

Regards,


> hi
> i am trying to modify the recv() and send() system calls in red hat linux
> kernel version 2.4.26. i am unable to find the code for the specified
> function in the kernel source code. can anyone please help me out in this
> matter.
>
> also i am having the following problems
>
> i am writing a kernel module for modifying read() and write() system
> calls
>  how do i know the process id of the calling process from this module?
>
> Hoping that someone can help me.
>
> warm regards,
> sundeep
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
-- ---
> This email was sent from IIT Guwahati Webmail.If you are not the
> intended recipient, please contact the sender by email and delete all
> copies; your cooperation in this regard is appreciated.
> http://www.iitg.ernet.in
>
>
>



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


--
Shrike-list mailing list
Shrike-list@(protected)
https://www.redhat.com/mailman/listinfo/shrike-list

Earn $52 per hosting referral at Lunarpages.