Location of syscall wrappers

Location of syscall wrappers

am 07.02.2008 07:35:08 von Rajat Jain

Hi,

If I remember correctly, there used to be syscall wrappers (_syscall3() etc) in the kernel that could be used to make system calls without any library support. I'm not able to locate them for i386. Where are they?

Thanks,

Rajat
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: Location of syscall wrappers

am 07.02.2008 07:48:44 von Sachin Gaikwad

On Feb 7, 2008 1:35 AM, Rajat Jain wrote:
>
> Hi,
>
> If I remember correctly, there used to be syscall wrappers (_syscall3() etc) in the kernel that could be used to make system calls
> without any library support. I'm not able to locate them for i386. Where are they?

Use syscall(SYSTEM_CALL_NUMBER, arg1, arg2, arg3);

_syscall3() macro are are not supported nowadays.

http://lkml.org/lkml/2007/7/5/314

Sachin

>
> Thanks,
>
> Rajat
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

RE: Location of syscall wrappers

am 07.02.2008 09:42:38 von Rajat Jain

Hi,

>
> Use syscall(SYSTEM_CALL_NUMBER, arg1, arg2, arg3);
>
> _syscall3() macro are are not supported nowadays.
>
> http://lkml.org/lkml/2007/7/5/314
>

Who is supposed to provide syscall()?? C library? Where do I find its definition (not declaration)?

What is an application supposed to do if it does not want to use the library?

Thanks,

Rajat
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: Location of syscall wrappers

am 07.02.2008 10:25:40 von Erik Mouw

--2B/JsCI69OhZNC5r
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Feb 07, 2008 at 02:12:38PM +0530, Rajat Jain wrote:
> Hi,
>=20
> >=20
> > Use syscall(SYSTEM_CALL_NUMBER, arg1, arg2, arg3);
> >=20
> > _syscall3() macro are are not supported nowadays.
> >=20
> > http://lkml.org/lkml/2007/7/5/314
> >=20
>=20
> Who is supposed to provide syscall()?? C library? Where do I find its
> definition (not declaration)?

libc provides syscall(). Definition can be found in syscall(2).

Use is like this (implementing inotify_add_watch()):

#include
#include
#include

static int inotify_add_watch(int fd, const char *path, unsigned int mask)
{
return syscall(__NR_inotify_add_watch, fd, path, mask);
}


> What is an application supposed to do if it does not want to use the
> library?

The same as an application should do if it wants to use printf() but
not libc: implement it yourself.


Erik

--=20
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery

--2B/JsCI69OhZNC5r
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHqs6U/PlVHJtIto0RAs/kAJ44gbGHF0GK9qSw9O3X8eF6yC1LcwCf XIRR
2gneaxt0LGpngg84vc+GWRI=
=SQBe
-----END PGP SIGNATURE-----

--2B/JsCI69OhZNC5r--

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Re: Location of syscall wrappers

am 07.02.2008 16:40:01 von Mulyadi Santosa

Hi...

On Feb 7, 2008 3:42 PM, Rajat Jain wrote:
> Who is supposed to provide syscall()?? C library? Where do I find its definition (not declaration)?

I think it could be the C kernel headers. I mean something like
/usr/include/asm...

> What is an application supposed to do if it does not want to use the library?

by calling sysenter or int 0x80 and put related parameters in certain registers?

regards,

Mulyadi.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: Location of syscall wrappers

am 07.02.2008 16:51:48 von Mulyadi Santosa

Hi..

On Feb 7, 2008 10:53 PM, Scott Lovenberg wrote:
> for 64 bit:
> /usr/include/asm-x86_64/ioctls.h
> /usr/include/bits/ioctls.h
>
> so, for all machines:
> /usr/include/asm-%arch%/ioctls.h
>

Thank you for the clarification.

regards,

Mulyadi.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: Location of syscall wrappers

am 07.02.2008 16:53:09 von Scott Lovenberg

This is a multi-part message in MIME format.
--------------000500010500040007000305
Content-Type: multipart/alternative;
boundary="------------040105040809000607080608"


--------------040105040809000607080608
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Mulyadi Santosa wrote:
> Hi...
>
> On Feb 7, 2008 3:42 PM, Rajat Jain wrote:
>
>> Who is supposed to provide syscall()?? C library? Where do I find its definition (not declaration)?
>>
>
> I think it could be the C kernel headers. I mean something like
> /usr/include/asm...
>
>
>> What is an application supposed to do if it does not want to use the library?
>>
>
> by calling sysenter or int 0x80 and put related parameters in certain registers?
>
> regards,
>
> Mulyadi.
>
for 64 bit:
/usr/include/asm-x86_64/ioctls.h
/usr/include/bits/ioctls.h

so, for all machines:
/usr/include/asm-%arch%/ioctls.h

--------------040105040809000607080608
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit







Mulyadi Santosa wrote:
cite="mid:f284c33d0802070740i29ff633bn95963585b69648f9@mail. gmail.com"
type="cite">

Hi...

On Feb 7, 2008 3:42 PM, Rajat Jain wrote:


Who is supposed to provide syscall()?? C library? Where do I find its definition (not declaration)?



I think it could be the C kernel headers. I mean something like
/usr/include/asm...



What is an application supposed to do if it does not want to use the library?



by calling sysenter or int 0x80 and put related parameters in certain registers?

regards,

Mulyadi.


for 64 bit:

/usr/include/asm-x86_64/ioctls.h

/usr/include/bits/ioctls.h



so, for all machines:

/usr/include/asm-%arch%/ioctls.h




--------------040105040809000607080608--

--------------000500010500040007000305
Content-Type: text/x-vcard; charset=utf-8;
name="scott_lovenberg.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="scott_lovenberg.vcf"

begin:vcard
fn:Scott Lovenberg
n:Lovenberg;Scott
email;internet:scott.lovenberg@gmail.com
title:Student
tel;cell:570-856-2999
x-mozilla-html:TRUE
url:http://www.scottlovenberg.com
version:2.1
end:vcard


--------------000500010500040007000305--

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ