Linux-Development-Sys Digest #568, Volume #8 Thu, 15 Mar 01 14:13:10 EST
Contents:
Re: Can linux be trusted? (Kasper Dupont)
Re: Errno and kernel (Kasper Dupont)
TCP implemenation changes (Lionel)
Re: Errno and kernel ("Mikael Chambon")
Re: 2.4.2 printing? ("Gene Heskett")
Re: Continuing NFS problems, thru Linux Kernel 2.4.2? ([EMAIL PROTECTED])
Allocation of task_struct structure (Julien Cavoizy)
Re: insmod reports unresolved kernel symbols (Parmeggiani Marco)
Re: Continuing NFS problems, thru Linux Kernel 2.4.2? (Bernd Strieder)
dynamic linking again (Daniel Koerner)
Re: kernel panic with IKD ("Omkar Sathe")
Re: Can linux be trusted? (Richard Heathfield)
Re: Can linux be trusted? ("Dave Korn")
Re: dynamic linking again (Samuel Hocevar)
Re: Processor ID
Re: Processor ID
Re: Processor ID
sigwaitinfo and SuSE7.1/linux2.4 ("Lawrence K. Chen, P.Eng.")
Maximum filename size ("Amir Shahindoust")
Re: Errno and kernel (Kasper Dupont)
Re: Kmalloc ("Joseph A. Knapka")
Re: Allocation of task_struct structure (Kasper Dupont)
----------------------------------------------------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Crossposted-To:
comp.lang.c,comp.os.linux.development.apps,comp.sys.be.programmer,comp.sys.mac.programmer.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.misc
Subject: Re: Can linux be trusted?
Date: Thu, 15 Mar 2001 13:14:19 +0000
Richard Heathfield wrote:
>
> Kasper Dupont wrote:
> >
> <snip>
> >
> > This is the standard library implementation of
> > strdup().
>
> There is no strdup() in the standard library if, by that term, you mean
> the library defined by the standard. I suspect the crosspost (which is
> *huge*) is beginning to bite. I read your article in comp.lang.c. If
> your reply was written in one of the other groups, then I certainly
> understand what you're saying, but clc looks at the library from a
> different angle.
I haven't actually looked on the list of newsgroups
before now, I have made the FUT list a lot shorter.
The implementation I posted was from glibc, which
is the standard on Linux systems and is the only
implementation I know for Linux systems.
>
> >
> > char * __strdup (const char *s)
>
> printf("%d\n", strcmp("strdup", "__strdup")); /* ;-) */
>
> <snip>
This line is present elsewhere in the file:
# define __strdup strdup
But I thought that was irrelevant for the
discussion, most people can figure out why they
are the same. Otherwise they can read the
documentation or the source.
>
> --
> Richard Heathfield
> "Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
> C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
> K&R Answers: http://users.powernet.co.uk/eton/kandr2/index.html
--
Kasper Dupont
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Errno and kernel
Date: Thu, 15 Mar 2001 13:38:11 +0000
Mikael Chambon wrote:
>
> Hi everybody
>
> Just a little question about errno, when I want to put a error message using
> the errno
> variable I just have to put the good code in sys_nerr that's it ??
>
> And if the user call perror (in userland), he should has the error message
> associated with the value of sys_nerr, that's it ?
>
> As I am doing a syscall (so in the kernel), should I take some special
> precautions??
>
> thanks for all !!
>
> --
> Mikael Chambon
> [EMAIL PROTECTED] || [EMAIL PROTECTED]
> ICQ 10249913 || http://www.cronos.org
Its a little unclear what you want to do.
Do you want to get the error message coresponding
to some error number? Or do you want to define a
new error number and a coresponding string?
If you just want to get the error message check
that (errno > 0 && errno <= sys_nerr) and then
use sys_errlist[errno].
If you want to add a new error message, your
probably have to change and recompile glibc, as
well as translate it to all supported languages
and recompile the zoneinfo files.
Notice that inside the kernel there is no errno
variable, instead functions returns a negative
number describing the error. E.g. return -ENOENT;
In glibc this value is then put into the errno
variable.
--
Kasper Dupont
------------------------------
From: Lionel <[EMAIL PROTECTED]>
Subject: TCP implemenation changes
Date: Thu, 15 Mar 2001 14:23:36 +0100
Hi,
I'm planning to make some changes to my TCP implementation, but I don't
know what is the best kernel version to start with.
I have 2.2.18 and 2.4.
Where they some major changes in the TCP implementation between these
two versions ? Is the TCP implementation of 2.4. stable enough to be a
good place to start, or better start with 2.2.18 implementation ???
I know that I can download both and make a diff between the TCP source
files but this won't probably give me a real answer to my question.
Thanks in advance for help.
Lionel
------------------------------
From: "Mikael Chambon" <[EMAIL PROTECTED]>
Subject: Re: Errno and kernel
Date: Thu, 15 Mar 2001 15:02:25 +0100
Oupps sorry if it's not clear !!
But you answered my question !!
In fact i am programing a syscall, and in this syscall I would like to set a
standard error message.
So if I understood well, I just return for example -EPERM, and the glibc
will return -1 and
when the user will call perror he will be able to see the EPERM associated
error message.
Am I right ??
Thanks for all,
--
Mikael Chambon
[EMAIL PROTECTED] || [EMAIL PROTECTED]
ICQ 10249913 || http://www.cronos.org
"Kasper Dupont" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Mikael Chambon wrote:
> >
> > Hi everybody
> >
> > Just a little question about errno, when I want to put a error message
using
> > the errno
> > variable I just have to put the good code in sys_nerr that's it ??
> >
> > And if the user call perror (in userland), he should has the error
message
> > associated with the value of sys_nerr, that's it ?
> >
> > As I am doing a syscall (so in the kernel), should I take some special
> > precautions??
> >
> > thanks for all !!
> >
> > --
> > Mikael Chambon
> > [EMAIL PROTECTED] || [EMAIL PROTECTED]
> > ICQ 10249913 || http://www.cronos.org
>
> Its a little unclear what you want to do.
> Do you want to get the error message coresponding
> to some error number? Or do you want to define a
> new error number and a coresponding string?
>
> If you just want to get the error message check
> that (errno > 0 && errno <= sys_nerr) and then
> use sys_errlist[errno].
>
> If you want to add a new error message, your
> probably have to change and recompile glibc, as
> well as translate it to all supported languages
> and recompile the zoneinfo files.
>
> Notice that inside the kernel there is no errno
> variable, instead functions returns a negative
> number describing the error. E.g. return -ENOENT;
> In glibc this value is then put into the errno
> variable.
>
> --
> Kasper Dupont
------------------------------
Date: 15 Mar 2001 9:54:36 -0500
From: "Gene Heskett" <[EMAIL PROTECTED]>
Subject: Re: 2.4.2 printing?
Gene Heskett sends Greetings to Harmon Seaver;
HS> Is anyone able to print with 2.4.2?
I *was*, using LPRng and tools, but tore that out to put in cups-1.1.6
this morning, which is now telling me, root, that my path to localhost
is broken. Taint, so we're on the slick side of the learning curve with
this puppy for sure.
The reason for the change is that none of the printtools can setup the
newer stp drivers even if they are compiled into ghostscript. And the
stcolor drivers have never really done a great job of driving my older
Epson Stylus Pro.
But yes, you can print with 2.4.2, you'll need rhs-printfilters
installed, ghostscript, LPRng (latest version for security reasons) and
lprngtool-1.1 or so.
Cheers, Gene
--
Gene Heskett, CET, UHK |Amiga A2k Zeus040, Linux @ 500mhz
email gene underscore heskett at iolinc dot net
#Amiga based X10 home automation program EZHome, see at:#
<http://www.thirdwave.net/~jimlucia/amigahomeauto>
This messages reply content, but not any previously quoted material,
is � 2001 by Gene Heskett, all rights reserved.
--
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Continuing NFS problems, thru Linux Kernel 2.4.2?
Date: Thu, 15 Mar 2001 16:28:57 +0100
Stefan Boresch <[EMAIL PROTECTED]> wrote:
>> Have you considered that it might be a bug in Digital UNIX?
> Possible, but unlikely. I have the same problem as the original
> poster even between Linux machines.
> The problem of the original poster arises when he tries to access a
> remote mail spool directory. I have the same problem between linux
> machines (mail programs such as mail, elm, mutt cannot lock the mail
> spool); my solution is to mount the mail spool directory with the
> 'nolock' option on the clients. I am not satisfied, because I now can
> read my mail simultaneously from two clients -- with occasional
> unpredictable results (well, I get confused somewhere, and I am logged
> on several machines at a time :-)
> I think it is fairly common wisdom that NFS is *not* one of linux
> strengths; if someone would enlighten me how I am supposed to export/mount
> a central mail spool (for incoming mail!) from the clients to the
> problems described, I would really appreciate it!
This way of sharing mail spool creates endless problems on all
sorts of machines. Even if it works (perhaps) on a pure Linux set
of machines, you can be sure to have problems as soon as you put
FreeBSD machines or Sun machines or others. The apparently
correct way is to put all mail in mailboxes controlled by some
program like cyrus imapd. Then people connect to imapd on just one
machine and you are fine. Plus, NFS is a good place for hackers
to exercise their talents on your machines.
> Stefan
> PS: Problem arises between RH 6.2 server<->client, as well as
> between RH 6.2 (server), and an experimental machine with kernel 2.4.2-ac3,
> latest mount etc... Permissions are not the problem, all machines
> are in the same NIS network!
--
Michel Talon
------------------------------
From: Julien Cavoizy <[EMAIL PROTECTED]>
Subject: Allocation of task_struct structure
Date: Thu, 15 Mar 2001 16:48:47 +0100
hi,
I'd like to add some new things in the process task_struct structure but
i cannot find where everything in the task struct are allocated.
In which .c file it is ?
a second question : Which size have a memory page ? (on an i586
processor)
thanks for all
Julien
[EMAIL PROTECTED]
------------------------------
From: Parmeggiani Marco <[EMAIL PROTECTED]>
Subject: Re: insmod reports unresolved kernel symbols
Date: Thu, 15 Mar 2001 16:42:22 +0100
Il giorno Wed, 14 Mar 2001 09:28:52 +1300, il gatto di Manfred Plagmann
<[EMAIL PROTECTED]> camminando sulla tastiera ha scritto:
>Hi,
>I am in the middle to write a simple ISA driver and tried to load it
>using insmod -f. It comes back with a list of unresolved symbols which
>are all (as far as I can tell) kernel symbols such as printk, kmalloc,
>kfree, register_chrdev, ...
>
>What am I missing? I tried to load A. Rubini's scull example driver with
>the very same result.
>
try using the -O2 option with gcc. it solved a similar problem...
ciao
--
maruko.cjb.net - Seti@Home applets
Designed for Windows
Powered by Linux
------------------------------
From: Bernd Strieder <[EMAIL PROTECTED]>
Subject: Re: Continuing NFS problems, thru Linux Kernel 2.4.2?
Date: Thu, 15 Mar 2001 16:50:11 +0100
Stefan Boresch wrote:
>
> I think it is fairly common wisdom that NFS is *not* one of linux
> strengths; if someone would enlighten me how I am supposed to export/mount
> a central mail spool (for incoming mail!) from the clients to the
> problems described, I would really appreciate it!
>
For that particular question: Use IMAP or POP3 daemon on the server and
email clients capable of this. These protocols are designed to transmit
only necessary information at any time, so it might even be more
efficient than accessing via NFS, where blocks of data are the unit to
be transmitted. Well, not all mail clients can do this, so you might
have some problems to convince your users to change.
Bernd Strieder
------------------------------
From: Daniel Koerner <[EMAIL PROTECTED]>
Subject: dynamic linking again
Date: Thu, 15 Mar 2001 17:04:27 +0100
Hi folks.
Is that tue that dynamic libraries are linked against "sublibraries" ?
Or is all linking the job of the main executable ?
Daniel
------------------------------
From: "Omkar Sathe" <[EMAIL PROTECTED]>
Subject: Re: kernel panic with IKD
Date: Thu, 15 Mar 2001 11:01:49 -0500
Thanks, Its now working for me.
lfree wrote in message <98pn8p$noa$[EMAIL PROTECTED]>...
>Your harddisk is SCSI harddisk,you must compile
------------------------------
Date: Thu, 15 Mar 2001 16:23:08 +0000
From: Richard Heathfield <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c
Subject: Re: Can linux be trusted?
Kasper Dupont wrote:
>
> Richard Heathfield wrote:
> >
> > Kasper Dupont wrote:
> > >
> > <snip>
> > >
> > > This is the standard library implementation of
> > > strdup().
> >
> > There is no strdup() in the standard library if, by that term, you mean
> > the library defined by the standard. I suspect the crosspost (which is
> > *huge*) is beginning to bite. I read your article in comp.lang.c. If
> > your reply was written in one of the other groups, then I certainly
> > understand what you're saying, but clc looks at the library from a
> > different angle.
>
> I haven't actually looked on the list of newsgroups
> before now, I have made the FUT list a lot shorter.
Indeed. Now all we need to do is lose comp.lang.c too, and your
description of strdup() being "standard" (in the Linux sense of the
word) will be accurate. :-)
> The implementation I posted was from glibc, which
> is the standard on Linux systems and is the only
> implementation I know for Linux systems.
Yes, but this thread was originally crossposted to several non-Linux
groups, which is why I pointed out that strdup is not standard, from the
C language point of view. It is of course standard from your point of
view, and I do understand that, so I'm not trying to jump on your case,
just playing a straight bat.
Followups set. :-)
<snip>
--
Richard Heathfield
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R Answers: http://users.powernet.co.uk/eton/kandr2/index.html
------------------------------
From: "Dave Korn" <[EMAIL PROTECTED]>
Crossposted-To:
comp.lang.c,comp.os.linux.development.apps,comp.sys.be.programmer,comp.sys.mac.programmer.misc,comp.unix.bsd.freebsd.misc,comp.unix.bsd.misc,gnu.gcc
Subject: Re: Can linux be trusted?
Date: Thu, 15 Mar 2001 14:11:59 -0000
Dik T. Winter wrote in message ...
> > How do you think 0.3 is represented in IEEE floating point?
>
>That is irrelevant.
Only if you have an infinite amount of memory in your computer. Otherwise
it is *very* relevant that the number 0.3 cannot actually be represented in
IEEE floating point.
DaveK
--
They laughed at Galileo. They laughed at Copernicus. They laughed at
Columbus. But remember, they also laughed at Bozo the Clown.
------------------------------
From: [EMAIL PROTECTED] (Samuel Hocevar)
Subject: Re: dynamic linking again
Date: 15 Mar 2001 17:25:29 GMT
On Thu, 15 Mar 2001 17:04:27 +0100,
Daniel Koerner <[EMAIL PROTECTED]> wrote:
> Is that tue that dynamic libraries are linked against "sublibraries" ?
Yes, unless they are statically linked. They are most of the time at
least linked against ld-linux (which itself is statically linked) and
the libc.
> Or is all linking the job of the main executable ?
More precisely, it's the job of ld-linux, the dynamic linker, to
resolve symbols between the libraries and the main executable. It also
loads what you call "sublibraries" when needed.
Note that if an executable is linked against libc and libfoo, then
libfoo doesn't technically need to be linked against libc because it
will be loaded nonetheless. But it's a good habit to always link dynamic
libraries against libc and all the other libraries they may require.
HTH,
Sam.
--
Samuel Hocevar <[EMAIL PROTECTED]> <http://sam.zoy.org/>
for DVDs in Linux screw the MPAA and ; do dig $DVDs.z.zoy.org ; done | \
perl -ne 's/\.//g; print pack("H224",$1) if(/^x([^z]*)/)' | gunzip
------------------------------
From: [EMAIL PROTECTED] ()
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.hardware
Subject: Re: Processor ID
Date: Thu, 15 Mar 2001 17:53:37 -0000
In article <987gkm$e3b$[EMAIL PROTECTED]>,
Victor Wagner <[EMAIL PROTECTED]> wrote:
>: IIRC, the x86 Linux kernel explicitly disables the processor ID
>: facility.
>If so, why the following in the help file for Configure of kernel 2.2.18?
>
>CONFIG_X86_CPUID
> This device gives processes access to the x86 CPUID instruction to
> be executed on a specific processor. It is a character device
> with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
> /dev/cpu/31/cpuid.
So you can have a choice of course.
--
http://www.spinics.net/linux/
------------------------------
From: [EMAIL PROTECTED] ()
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.hardware
Subject: Re: Processor ID
Date: Thu, 15 Mar 2001 17:56:43 -0000
In article <%SCp6.145757$[EMAIL PROTECTED]>,
Chronos Tachyon <[EMAIL PROTECTED]> wrote:
>Actually, it's even easier than that. With the vast majority of Ethernet
>drivers, it's as simple as "ifconfig eth0 hw ether 01:23:45:67:89:AB".
>Obviously, this never touches the firmware so the "real" MAC is not
>permanently altered.
It's a Good Thing too. One place I was working got a shipment of
about 100 Intel NICS that came with the same MAC address. Of course
we didn't find out until they were in the field ;(
--
http://www.spinics.net/linux
------------------------------
From: [EMAIL PROTECTED] ()
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.hardware
Subject: Re: Processor ID
Date: Thu, 15 Mar 2001 18:00:16 -0000
In article <[EMAIL PROTECTED]>,
Kasper Dupont <[EMAIL PROTECTED]> wrote:
>MAC addresses of ethernet cards on the other
>hand are sent over the network every time you
>send a packet.
No, MAC addresses are sent only over your local
network *segment*.
>Can anybody explain WHY people are so unhappy
>about the CPUid?
One example: web browsers could start sending the id
as part of the http protocol which would increase
the ability of web sites to track users.
--
http://www.spinics.net/linux/
------------------------------
From: "Lawrence K. Chen, P.Eng." <[EMAIL PROTECTED]>
Subject: sigwaitinfo and SuSE7.1/linux2.4
Date: Thu, 15 Mar 2001 12:22:33 -0500
Is sigwaitinfo supposed to be broken in Linux? Or is there an update that
will make it work?
I'm trying to use signal notification of AIO request completion....with a
thread with a for(ever) loop blocked on sigwaitinfo() to processing the
completed requests.
Probably is my thread never wakes up from sigwaitinfo().
FWIW, here's the current version of the test program:
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <pthread.h>
#include <aio.h>
#include <semaphore.h>
#include <errno.h>
#ifndef USE_SIG
#define USE_SIG SIGRTMIN+3
#endif
#define uS_PER_SECOND 1000000
#define BOUND1 32
#define BOUND2 256
#define BOUND3 64
#define DA_PAGE_SIZE 512
#define DA_PAGE_BYTES DA_PAGE_SIZE*sizeof(int)
#define error(x) {perror((x)); exit(0);}
void *ACT(void *);
pthread_t ACT_thread;
int AioDone;
sem_t semAioWaitDone;
static struct aiocb Aiocb[BOUND1];
main()
{
struct timeval tv0, tv1, tvd;
int fh, i, j, k, l;
int buf[BOUND1][DA_PAGE_SIZE], fbuf[BOUND1][DA_PAGE_SIZE];
static struct aiocb *Aiocb_list[BOUND1];
static struct flock w1lock = {F_WRLCK,0,1,0,0};
int done;
int aioerr;
sigset_t sigs_to_block;
AioDone = 0;
sem_init(&semAioWaitDone,1,0);
sigemptyset(&sigs_to_block);
sigaddset(&sigs_to_block,USE_SIG);
pthread_sigmask(SIG_BLOCK,&sigs_to_block,NULL);
pthread_create(&ACT_thread, NULL, ACT, NULL);
sleep(1);
for (i = 0; i < BOUND1; i++)
{
memset(buf[i],0,DA_PAGE_BYTES);
memset(fbuf[i],0,DA_PAGE_BYTES);
}
gettimeofday(&tv0,NULL);
unlink("test.file");
fh = open("test.file",
O_RDWR|O_CREAT,
S_IRWXU|S_IRWXG|S_IRWXO);
fcntl(fh,F_SETLK,&w1lock);
for (k = 0; k < BOUND3; k++)
{
for (j = 0; j < BOUND2; j++)
{
for (i = 0; i < BOUND1; i++)
{
buf[i][DA_PAGE_SIZE-1] = i+(j*BOUND1)+(k*BOUND2*BOUND1);
Aiocb[i].aio_fildes = fh;
Aiocb[i].aio_offset = (i*DA_PAGE_BYTES)+(j*BOUND1*DA_PAGE_BYTES);
Aiocb[i].aio_buf = buf[i];
Aiocb[i].aio_nbytes = DA_PAGE_BYTES;
Aiocb[i].aio_sigevent.sigev_notify = SIGEV_SIGNAL;
Aiocb[i].aio_sigevent.sigev_signo = USE_SIG;
Aiocb[i].aio_sigevent.sigev_value.sival_int = i;
Aiocb[i].aio_reqprio = 0;
Aiocb[i].aio_lio_opcode = 0;
Aiocb_list[i] = &Aiocb[i];
if (aio_write(&Aiocb[i]) == -1)
error("aio_write");
}
while (sem_wait(&semAioWaitDone) == -1 && errno == EINTR)
;
printf("Loop = %09d\n",k*BOUND2+j);
}
}
printf("\n");
close(fh);
gettimeofday(&tv1,NULL);
tvd.tv_usec = tv1.tv_usec - tv0.tv_usec;
tvd.tv_sec = tv1.tv_sec - tv0.tv_sec;
if (tvd.tv_usec < 0)
{
tvd.tv_usec += uS_PER_SECOND;
tvd.tv_sec--;
}
printf("%d.%0d Seconds for Test Async I/O\n",
tvd.tv_sec,tvd.tv_usec/1000);
}
void *ACT(void *pArg)
{
sigset_t sigs_to_catch;
int caught;
siginfo_t siginfo;
sigemptyset(&sigs_to_catch);
sigaddset(&sigs_to_catch,USE_SIG);
for (;;)
{
int aioerr;
int aioret;
int AioWaitFlag;
int fail = 0;
caught = sigwaitinfo(&sigs_to_catch, &siginfo);
fprintf(stderr,"AioDone = %03d",AioDone);
if (caught != USE_SIG)
{
fprintf(stderr,"\nUnknown Signal Caught %d\n",caught);
continue;
}
if (caught != siginfo.si_signo)
{
fprintf(stderr,"\nsiginfo.si_signo mismatch\n");
fail = 1;
}
if (siginfo.si_errno)
{
fprintf(stderr,"\nsiginfo.si_errno %s\n",strerror(siginfo.si_errno));
fail = 1;
}
if (siginfo.si_code != SI_ASYNCIO)
{
fprintf(stderr,"\nsiginfo.si_code = %d\n",siginfo.si_code);
fail = 1;
}
if (fail)
{
fprintf(stderr,"siginfo.si_value.sival_int = %d\n",
siginfo.si_value.sival_int);
exit(-1);
}
aioerr = aio_error(&Aiocb[siginfo.si_value.sival_int]);
aioret = aio_return(&Aiocb[siginfo.si_value.sival_int]);
if (aioret == -1)
fprintf(stderr,"\naio_write: %s\n",strerror(aioerr));
AioDone++;
if (AioDone == BOUND1)
{
fprintf(stderr,"\n");
sem_post(&semAioWaitDone);
AioDone = 0;
}
else
{
fprintf(stderr,"\r");
}
}
}
--
Who: Lawrence Chen, P.Eng. Email: [EMAIL PROTECTED]
What: Software Developer URL: http://www.opentext.com/basis
Where: Open Text, BASIS Division Phone: 614-761-7449
5080 Tuttle Crossing Blvd. Fax: 614-761-7269
M/S 7&8
Dublin, OH 43016 ICQ: 12129673
DISCLAIMER: All opinions expressed are mine and *NOT* my employers
------------------------------
From: "Amir Shahindoust" <[EMAIL PROTECTED]>
Subject: Maximum filename size
Date: Thu, 15 Mar 2001 18:21:39 GMT
Hi,
I'm new to Linux. I need to know what is the maximum number of characters
that a full path name can have in Linux. can anybody tell me please.
Thanks!
Amir Shahindoust
[EMAIL PROTECTED]
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Errno and kernel
Date: Thu, 15 Mar 2001 18:23:49 +0000
Mikael Chambon wrote:
>
> Oupps sorry if it's not clear !!
>
> But you answered my question !!
>
> In fact i am programing a syscall, and in this syscall I would like to set a
> standard error message.
>
> So if I understood well, I just return for example -EPERM, and the glibc
> will return -1 and
> when the user will call perror he will be able to see the EPERM associated
> error message.
>
> Am I right ??
Exactly
>
> Thanks for all,
You are welcome
>
> --
> Mikael Chambon
> [EMAIL PROTECTED] || [EMAIL PROTECTED]
> ICQ 10249913 || http://www.cronos.org
> "Kasper Dupont" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > Mikael Chambon wrote:
> > >
> > > Hi everybody
> > >
> > > Just a little question about errno, when I want to put a error message
> using
> > > the errno
> > > variable I just have to put the good code in sys_nerr that's it ??
> > >
> > > And if the user call perror (in userland), he should has the error
> message
> > > associated with the value of sys_nerr, that's it ?
> > >
> > > As I am doing a syscall (so in the kernel), should I take some special
> > > precautions??
> > >
> > > thanks for all !!
> > >
> > > --
> > > Mikael Chambon
> > > [EMAIL PROTECTED] || [EMAIL PROTECTED]
> > > ICQ 10249913 || http://www.cronos.org
> >
> > Its a little unclear what you want to do.
> > Do you want to get the error message coresponding
> > to some error number? Or do you want to define a
> > new error number and a coresponding string?
> >
> > If you just want to get the error message check
> > that (errno > 0 && errno <= sys_nerr) and then
> > use sys_errlist[errno].
> >
> > If you want to add a new error message, your
> > probably have to change and recompile glibc, as
> > well as translate it to all supported languages
> > and recompile the zoneinfo files.
> >
> > Notice that inside the kernel there is no errno
> > variable, instead functions returns a negative
> > number describing the error. E.g. return -ENOENT;
> > In glibc this value is then put into the errno
> > variable.
> >
> > --
> > Kasper Dupont
--
Kasper Dupont
------------------------------
From: "Joseph A. Knapka" <[EMAIL PROTECTED]>
Subject: Re: Kmalloc
Date: Thu, 15 Mar 2001 18:17:14 GMT
Mikael Chambon wrote:
>
> Thanks
>
You're welcome. I have a correction to make; see below.
> >
> > > In the case I must use kmalloc, which priority should I use ??
> >
> > Read the commentary in mm/slab.c re. kmalloc(). Probably you
> > want GFP_ATOMIC if you're allocating within a device driver.
> > Otherwise, just choose whatever is appropriate.
> >
Actually, having read some of the linux-mm list archives, I can now
tell you that in all kernel code you should use either GFP_ATOMIC
(if your code must not sleep, eg you are inside an interrupt
handler), or GFP_KERNEL if it is permissible to sleep. All other
GFP_* are used only by the VM system or other magical hidden
kernel subsystems that we mortals ought not to interfere with.
-- Joe Knapka
"It was just a maddened crocodile hidden in a flower bed. It could
have happened to anyone." -- Pratchett
// Linux MM Documentation in progress:
// http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
* Evolution is an "unproven theory" in the same sense that gravity is. *
------------------------------
From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Allocation of task_struct structure
Date: Thu, 15 Mar 2001 18:34:27 +0000
Julien Cavoizy wrote:
>
> hi,
>
> I'd like to add some new things in the process task_struct structure but
> i cannot find where everything in the task struct are allocated.
>
> In which .c file it is ?
>
It is not in a .c file it is in a .h file.
linux/include/linux/sched.h
Notice that changing this struct will require you
to recompile your kernel and lots of modules.
The first fields are as stated in a comment hardcoded
in assembly code, so insert your own stuff at the end.
It would be even better to insert it in some structure
reference from the task struct, if there are any
resonable choice.
Notice that each process have 8KB (2 pages) allocated
for both this structure and kernel stack, if the
structure grows too much you might get stack overflows.
> a second question : Which size have a memory page ? (on an i586
> processor)
4KB.
>
> thanks for all
>
> Julien
> [EMAIL PROTECTED]
--
Kasper Dupont
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list by posting to the
comp.os.linux.development.system newsgroup.
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************