Re: How is the size of init ram disk determined when initramfs is used?

2023-01-01 Thread Bernd Petrovitsch
AM for the bootimage, 16MB physical RAM - it was Kernel 2.4.0 in 2000:-). Kind regards, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at There is NO CLOUD, just other people's computers. - FSFE LUGA

Re: thrashing on format %u vs size_t arg

2021-09-15 Thread Bernd Petrovitsch
On 15/09/2021 18:20, jim.cro...@gmail.com wrote: On Tue, Sep 14, 2021 at 10:47 PM Bernd Petrovitsch wrote: On 15/09/2021 00:38, jim.cro...@gmail.com wrote: I will cast and be done with it Or you use - like everyone else - "%zu" as format specifier. Read `man 3 printf

Re: thrashing on format %u vs size_t arg

2021-09-15 Thread Bernd Petrovitsch
Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at There is NO CLOUD, just other people's computers. - FSFE LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies

Re: [Clarification] writes to kernel addresses that came from userspace

2021-09-13 Thread Bernd Petrovitsch
see the problem. Sorry if it is a trivial question but I can not figure it out on my own. Shouldn't the memcpy() be a copy_to_user() as object.address is setup by the user space and thus a user space address? MfG, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv

Re: Understanding merge window and next-tree

2021-09-11 Thread Bernd Petrovitsch
ill be merged > into the mainline. The main purpose of the -next tree is to identify (and solve) merge issues (way) before the merge window so that there is less stress and chaos in the merge window. MfG, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.a

Re: macro version of __func__ ?

2021-08-03 Thread Bernd Petrovitsch
reprocessor concatenation bloats the kernels memory footprint massively. [...] > is there a kernel macro version that would allow this "optimization" ? pr_*() are slow per se so optimizing there (apart from readability and size od code+data) is wasted time. MfG, Bernd -- Be

Re: Return value for "impossible" situations

2021-07-26 Thread Bernd Petrovitsch
ng the wrong issue.) The error in userspace is usually seen by mere users and not some admin/root/kernel hacker so it makes no sense to bug them with it - let alone look into dmesg output and try to learn something from it. MfG, Bernd -- Bernd Petrovitsch Email :

Re: Return value for "impossible" situations

2021-07-26 Thread Bernd Petrovitsch
ng the wrong issue.) The error in userspace is usually seen by mere users and not some admin/root/kernel hacker so it makes no sense to bug them with it - let alone look into dmesg output and try to learn something from it. MfG, Bernd -- Bernd Petrovitsch Email :

Re: Return value for "impossible" situations

2021-07-25 Thread Bernd Petrovitsch
o choose the value (the list and short explanation is in `man errno`) which leads the userspace application and it's user in the best direction. And no, you can't invent new values. MfG, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at There is NO CLOUD, j

Re: Importing the Japanese Shift-JIS encoding to the kernel's locale

2021-04-24 Thread Bernd Petrovitsch
userspace issue (as Vladis already wrote), talk to your distribution. And top-posting is evil. > On Sat, Apr 24, 2021 at 1:51 AM Valdis Klētnieks > mailto:valdis.kletni...@vt.edu>> wrote: [...]> This is not a kernel problem. Seconded. MfG, Bernd -- Bernd Petrovitsc

Re: How to switch between installed kernel and developed kernel

2021-03-22 Thread Bernd Petrovitsch
he kernel if that makes sense ... MfG, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at There is NO CLOUD, just other people's computers. - FSFE LUGA : http://www.luga.at ___ Kernelnewbies mailin

Re: some u-boot mailing list

2020-10-15 Thread Bernd Petrovitsch
Hi all! On 15/10/2020 07:38, Tomek The Messenger wrote: [...] > Does anybody know some u-boot mailing list like here for linux, but for > u-boot. Is someone subscribed maybe somewhere? I have question about what > might be a potential rootcause of synchronous abort which I get when > executing

Re: Not able to find reference text for the latest linux kernel process scheduler

2020-09-15 Thread Bernd Petrovitsch
Hi! On 15.09.20 14:13, Rohit Chourasia wrote: [...] > I have just begun studying the linux process scheduling and I find that most > of the textsbooks are quiet outdated and the latest kernel codes do not match > the text. > How should I proceed further ?  Use the source, Luke;-) MfG,

Re: Scheduler benchmarks

2020-08-19 Thread Bernd Petrovitsch
On 19/08/2020 10:16, Muni Sekhar wrote: > On Tue, Aug 18, 2020 at 11:45 PM peter enderborg > wrote: [...] >> On the 4.4 kernel you dont have >> >> +CONFIG_RETPOLINE=y >> +CONFIG_INTEL_RDT=y > Thanks! That is helpful. Yes, I see 4.4 kernel don't have the above > two config options. > What analysis

Re: SElinux and its own error code?

2020-05-03 Thread Bernd Petrovitsch
Hi all! On 03/05/2020 03:55, Jeffrey Walton wrote: [...] > I lost about four hours chasing inaccurate messages from Apache. It Only 4hours? ;-) SCNR ... > turns out SElinux was denying access, so the EPERM was not really > accurate. But Apache saw EPERM or EACCESS and logged a message related >

Re: How can I compile a rc kernel myself?

2020-03-21 Thread Bernd Petrovitsch
;-) MfG, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo

Re: difference between /usr/lib/modules and /lib/modules

2020-03-20 Thread Bernd Petrovitsch
Hi! On 20/03/2020 10:24, Fabien R wrote: [...] > Being used to cross-compile my kernel on a faster machine, I noticed the > existence of both directories > after installing it with update-grub. > Since 'du' showed that they have the same size, it's a waste of space. > Is it possible to use only

Re: transfer physical memory page to swap disk

2020-01-19 Thread Bernd Petrovitsch
(possibly with a self-build malloc/free-equivalent or memory pools), the application can mmap() it and munmap() it simply when it's done. You can experiment with setting the process limits via setrlimit() to smaller or larger values. MfG, Bernd -- Bernd Petrovitsch

Re: Alternate method of running swapon?

2020-01-08 Thread Bernd Petrovitsch
Hi all! On 08/01/2020 19:09, Jeffrey Walton wrote: [...] > I work with an open source project. We have a VM but it is low-end. > The machine suffers OOM kills. We don't have access to /etc/fstab. Apparently you run too many (or too fat) programs;-) > Everything is an upsell with the VPS

Re: Kernel Module with multiple source files not initializing

2019-10-28 Thread Bernd Petrovitsch
On 28/10/2019 10:43, Irfan Ullah (울라 이르판) wrote: > Thanks for the help. I have removed the "static" from the hello_init, > hello_exti but nothing worked. I am not sure, but I think the problem is > with the make file. OK, when I add "static" to my driver, it works too. Sry for the confusion. I

Re: Kernel Module with multiple source files not initializing

2019-10-27 Thread Bernd Petrovitsch
uot;nm" doesn't show it, it's either not there or "static". [ for the nm-output see in the OPs mail ] > Can you please help me: what's the problem/mistake I am doing? > Thank you very much. Get rid of the "static" for the hello_init and hello_exit function. MfG,

Re: Try/catch for modules?

2019-10-18 Thread Bernd Petrovitsch
On 18/10/2019 18:11, Martin Galvan wrote: > El vie., 18 oct. 2019 a las 13:05, Bernd Petrovitsch > () escribió: >> You actually want speed in the kernel and not necessarily extra effort >> for "try" and "catch" which is - sooner or later - never really used.

Re: Try/catch for modules?

2019-10-18 Thread Bernd Petrovitsch
On 18/10/2019 17:43, Martin Galvan wrote:> El jue., 17 oct. 2019 a las 19:13, Valdis Klētnieks > () escribió: >> >> For starters, the *correct* in-kernel way to deal with this is: >> if (!ptr) { >> printk("You blew it!\n"); >> goto you_blew_it; >> }

Re: Overwriting copy functionality in filesystem

2019-03-23 Thread Bernd Petrovitsch
d but the usual (while simplest, most versatile and probably fastest) method used is: open source and destination files, read from the source, write into the destination until EOF. MfG, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at

Re: How to signal kernel that shared library is not in use by any process anymore ?

2018-12-21 Thread Bernd Petrovitsch
(when linking the application). > 3. Whether to compile and link executable with this library or leave > unresolved symbols? You do not call the functions directly (and you cannot as the linker cannot resolve them anyways as the linker doesn't know the library). MfG,

Re: stap shows kfree() is 5 times more than kallocs, how could be?

2018-10-15 Thread Bernd Petrovitsch
Hi all! On 15/10/18 14:17, Lev Olshvang wrote: [...] > I am debugging kernel module and use SystemTap to monitor requested and > freed memory. > > I see that SystemTap statistics shows that kfree() is called 5 times more > than kalloc. > It happens not only on my module, it happens on

Re: is this list still alive?

2018-09-21 Thread Bernd Petrovitsch
ullquote deleted - please don't top-post ] MfG, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at pEpkey.asc Description: application/pgp-keys ___ Kernelnewbies m

Re: System call vs POSIX call

2018-08-16 Thread Bernd Petrovitsch
in that direction). Not everyone everywhere has a (somewhat) recent kernel. MfG, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kern

Re: Year 2038 time set problem

2018-03-05 Thread Bernd Petrovitsch
s? The upstream can't do anything directly if the downstream simply refuses to update (if there are fixes to real threats) and/or reboot (if it's the kernel). MfG, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : ht

Re: CodingStyle indentation and alignment

2016-09-27 Thread Bernd Petrovitsch
e.g. `indent` and probably all source code formatters hava that too) so that known/intended violations for good reason are silenced. Bernd [0]: And "checkpatch" is a good tool but it is just a tool and one       needs to see the source to decide if it's better - not the s

[SPAM] Re: How do you test Linux kernel?

2016-07-20 Thread Bernd Petrovitsch
actually and if it exists - even more important - how useful is that? Kind regards, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kern

Re: variant length array?

2016-04-06 Thread Bernd Petrovitsch
Hi! On Die, 2016-04-05 at 15:29 -0400, Wenda Ni wrote: [...] > I come across the following code in a kernel module code. It defines an > array whose length is variant at runtime, depending on the actual inputs. > It seems that kernel compiler supports this, which is obvious an error in > the

Re: Attach my own pid

2016-03-22 Thread Bernd Petrovitsch
On Die, 2016-03-22 at 01:26 -0400, valdis.kletni...@vt.edu wrote: > On Mon, 21 Mar 2016 16:01:41 +0530, Nitin Varyani said: > > > I am running a master user-level process at Computer 1 which sends a > > process context like code, data, registers, PC, etc as well as *"pid"* to > > slave processes

Re: SHA-1 hash calculate in Kernel.

2015-08-29 Thread Bernd Petrovitsch
On Fre, 2015-08-28 at 15:36 +0800, lx wrote: [...] //way 2 /* char *plaintext = kmalloc(sizeof(char), GFP_KERNEL); plaintext = c; I don't think that this line doesn't give any warning ... Kind regards, Bernd -- I dislike type abstraction if it has no real reason. And

Re: what is the use of #ifndefs

2015-07-21 Thread Bernd Petrovitsch
Hi all! On Die, 2015-07-21 at 11:04 +0530, Amit Pandey wrote: [... crap deleted ...] Please let me know whether I was clear with the explanation. It was clear and it is total and absolute crap: - first, check with the .h (and .c) files in the kernel (and all others which get it right), that

Re: goto???

2015-07-17 Thread Bernd Petrovitsch
Hi! On Fre, 2015-07-17 at 15:55 +0800, Navy wrote: [...] Goto is recommend in linux kernel programming, but it is despised in many other situation. There are four rationable for using goto in goto is (usually totally) forbidden for beginners/inexperienced programmers because some of us are

Re: About head of kernel linked list structure

2015-05-07 Thread Bernd Petrovitsch
Hi all! On Don, 2015-05-07 at 17:57 +0700, Mulyadi Santosa wrote: On Wed, May 6, 2015 at 5:39 PM, Huaicheng Li lhc...@gmail.com wrote: In my understanding, the head initialised using LIST_HEAD_INIT or defined by LIST_HEAD corresponds to no *real* data field. But it *does* have its own

Re: catch exit status of daemon

2015-01-07 Thread Bernd Petrovitsch
On Mit, 2015-01-07 at 14:40 +0530, Yash Jain wrote: wait and waitpid would not work because a Process A would wait for process B(which is a parent of the daemon), process B immediately exits and process A would be notified. In my case, I want to query the status of process C(which is child of

Re: Improve my Rep

2014-09-16 Thread Bernd Petrovitsch
On Mon, 2014-09-15 at 10:38 -0400, Nick Krause wrote: After issues with the community I am wondering how to improve my rep Since you ignore good advice from *lots of* people and you are incapable to learn anything: by going somewhere else and not trolling here around. Bernd -- I

Re: Help with btrfs project

2014-08-20 Thread Bernd Petrovitsch
On Mit, 2014-08-20 at 17:25 -0400, Nick Krause wrote: On Wed, Aug 20, 2014 at 1:58 PM, Sudip Mukherjee sudipm.mukher...@gmail.com wrote: [...] i asked a few questions . why dont you answer them and show every one that you can. I may have deleted your email but , please send me your

Re: Kernel Dev - Nick Krause

2014-08-16 Thread Bernd Petrovitsch
On Fre, 2014-08-15 at 13:06 -0400, Nick Krause wrote: [ completely useless full-quote deleted ] You are constantly full-quoting emails without any sane reason which proves that you do not read and do not think about what people write to you. As a concrete example: You write mails to this mailing

Re: Creating Patches

2014-06-03 Thread Bernd Petrovitsch
On Die, 2014-06-03 at 22:15 +0530, me storage wrote: [...] My doubt is how to create patch file which contains the modifications only i.e lines with + only why because for example initially if a file contains 1000 rows after i changed 2 lines but in the patch file it is taking entire 1000+2

Re: Simple Misc Driver - Problem with string copy to user

2014-05-27 Thread Bernd Petrovitsch
Hi! On Die, 2014-05-27 at 10:09 -0300, Lucas Tanure wrote: Wow, many thanks. So the read operation should return the total number of bytes, not a true/false int. The syscall here (done by `head`) is read() ... I need to read more about this operations. .. and the drivers .read function is

Re: Deleting a line from a file

2014-05-15 Thread Bernd Petrovitsch
the /etc/fstab. I don't know if you want to do that - /etc/mtab is (historically?) used to record actually mounted filesystems. (At least) in the Linux world, there is /proc/mounts where the kernel tells you exactly that. Bernd -- Bernd Petrovitsch Email

Re: Deleting a line from a file

2014-05-15 Thread Bernd Petrovitsch
On Mit, 2014-05-14 at 11:18 -0400, valdis.kletni...@vt.edu wrote: On Wed, 14 May 2014 16:34:20 +0200, Bernd Petrovitsch said: sed -i 's#^/opt/new1.*$#d' file_entries.txt You don't even need the leading 's'. Just /pattern/d is sufficient. Ooops, yes, thanks. So sed -i '/\/opt\/new1

Re: Deleting a line from a file

2014-05-14 Thread Bernd Petrovitsch
' file_entries.txt should do it Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org

Re: Linux-wireless: why use macro to call functions

2013-12-23 Thread Bernd Petrovitsch
top posting completely. [... fullquote deleted ...] Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http

Re: How can I 'getchar()' in module code?

2013-12-05 Thread Bernd Petrovitsch
On Mit, 2013-12-04 at 23:21 +0200, Daniel Baluta wrote: On Tue, Dec 3, 2013 at 4:20 PM, Bernd Petrovitsch be...@petrovitsch.priv.at wrote: On Die, 2013-12-03 at 08:38 -0500, valdis.kletni...@vt.edu wrote: On Tue, 03 Dec 2013 20:35:41 +0800, said: For debugging purpose, I want something

Re: How can I 'getchar()' in module code?

2013-12-03 Thread Bernd Petrovitsch
machine. You probablhy want to be looking at the kgdb support, that is coded to work around a lot of the issues and you get full GDB support not just a getchar() pause. Or just use printk() to print interesting values in interesting cases. Bernd -- Bernd Petrovitsch

Re: How to define function-like macro?

2013-11-26 Thread Bernd Petrovitsch
. If not, you need to fix the Makefile - you can set the shell to be used there. *bash*should support that machanism, I guess. How should I do? Any suggestion? And what has that to do with any/the shell? Kind regards, Bernd -- Bernd Petrovitsch Email

Re: Best practice to lock a read/write to a HW register

2013-11-14 Thread Bernd Petrovitsch
-context - see also other mails - you must use the *_irq() variant. Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies

Re: YAFFS2 not part of Linux Kernel

2013-04-16 Thread Bernd Petrovitsch
it . Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo

Re: how to get outsated mail ?

2013-01-21 Thread Bernd Petrovitsch
mail client? Find mbox files or whatever your mailclient can import. Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies

Re: How does __user works?

2013-01-21 Thread Bernd Petrovitsch
(which can be swapped out and - therefore - shouldn't dereferenced directly) and some of it is kernel-space memory (which is always in real RAM). That macro tells static checkers in which of those the pointer points to so that errors are compile-time visible. Bernd -- Bernd Petrovitsch

Re: Re:Re: Re:Re: gcc 2.95.3 compile failure

2012-12-21 Thread Bernd Petrovitsch
On Fre, 2012-12-21 at 09:11 +0800, horse_rivers wrote: At 2012-12-20 18:01:40,Bernd Petrovitsch be...@petrovitsch.priv.at wrote: On Don, 2012-12-20 at 11:11 +0800, horse_rivers wrote: [] becasue i want to compile linux 2.6 version kernel ,which require gcc2.95.3 2.6 as such covers

Re: Re:Re: gcc 2.95.3 compile failure

2012-12-20 Thread Bernd Petrovitsch
-- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

RE: FIFO

2012-11-29 Thread Bernd Petrovitsch
play the server role and the other one the client role. but with sockets, you need netcat or socat(1) Kind regards, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at

Re: FIFO

2012-11-28 Thread Bernd Petrovitsch
(when user-space read(2)s it), you just return 0 (instead of sleeping/blocking the process) if you are at the end of the output. Kind regards, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at

Re: [OT] Can a commercial company use software with GPLv2 for free?

2012-11-16 Thread Bernd Petrovitsch
this . [ Full quote deleted ] Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http

Re: [OT] Can a commercial company use software with GPLv2 for free?

2012-11-15 Thread Bernd Petrovitsch
with commercial or non-commercial. And the opposite of free software is proprietary software. BTW are they any non-commercial companies? Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at

Re: recvfrom a large packet

2012-11-07 Thread Bernd Petrovitsch
On Mit, 2012-11-07 at 00:09 -0500, devendra.aaru wrote: On Tue, Nov 6, 2012 at 5:20 PM, Bernd Petrovitsch be...@petrovitsch.priv.at wrote: On Die, 2012-11-06 at 16:08 +0200, Victor Buciuc wrote: On Tue, Nov 6, 2012 at 1:35 PM, devendra.aaru devendra.a...@gmail.com wrote: if i do

Re: Callback function from kernel module

2012-11-07 Thread Bernd Petrovitsch
or implement a character device directly. Kind regards, Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org

Re: recvfrom a large packet

2012-11-06 Thread Bernd Petrovitsch
. (I assumed it's UDP we're talking about). That is actually the only robust way: 1) append the read data to a buffer 2) check if enough is there to handle a packet. If not goto 1) 3) handle the first packet and delete it. 4) goto 2) Kind regards, Bernd -- Bernd Petrovitsch

Re: Why exported const value modified by another driver not updated in original driver

2012-09-04 Thread Bernd Petrovitsch
this question silly? That all is actually pure (KR-)C and has nothing to do with the kernel. static const int value = 123; [...] EXPORT_SYMBOL(value); I wonder if we can modify EXPORT_SYMBOL() so that it compile-time-fails for static variables. And if we actually want that. Bernd -- Bernd

Re: is memcpy a system call?

2012-06-12 Thread Bernd Petrovitsch
Hi! On Fre, 2012-06-08 at 20:51 +0530, siddharth saxena wrote: [...] Memcpy is both- a system call as well as a user library function. Implementation differs What makes you believe this? Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at

Re: [RFC]confusions about 'struct' define

2012-06-01 Thread Bernd Petrovitsch
. But it is not trivial in very large projects like the Linux kernel to keep somewhat logical and clean and circular-free -h files. And you also do not really want a separate .h file for each struct. Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http

Re: How to figure out the byteorder only with one byte number?

2012-02-21 Thread Bernd Petrovitsch
(on i386, it is equal since ages BTW) mainly because it makes absolutely no sense. d) There is hardware with bit-addressable memory out there. Go read the manual and the same as c) I doubt that it is different even for really old machines Bernd -- Bernd Petrovitsch

Re: How to figure out the byteorder only with one byte number?

2012-02-19 Thread Bernd Petrovitsch
On Sun, 2012-02-19 at 20:08 +0800, Tao Jiang wrote: [...] Is there some difference of the storge between BE and LE machine inside a byte? No. At least TTBOMK there exists no such hardware. Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at

Re: difference between ACLs and SElinux

2012-02-13 Thread Bernd Petrovitsch
Hi! On Mon, 2012-02-13 at 14:30 +0530, bharat dhaker wrote: [...] I want to know the differences between ACLs and SElinux. Does anyone know which file-systems supports SElinux? Google knows;-) Actually you make a small partition for each filesystem and try it out. Bernd -- Bernd

Re: fork() and exec()

2012-02-07 Thread Bernd Petrovitsch
() is actually a function to be avoided. wait(NULL); You should check the return value here to know why wait() returns. printf(Wait over\n); printf(Inside parent a=%d\n, a); } return 0; } Bernd -- Bernd Petrovitsch

Re: Tool for automatic style of coding guidelines

2012-01-28 Thread Bernd Petrovitsch
); is split on 2 lines. And if (some_condition) x = 1; else { x = 4711; y = 45; } also hurts my eyes. Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http

Re: using sizeof operator

2012-01-23 Thread Bernd Petrovitsch
On Son, 2012-01-22 at 23:58 +0530, Sukrit Sangwan wrote: also i want to ask why not use simply 8 instead of sizeof(u8). Because it is wrong. Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at

Re: Question on Memory Leak: very tough problem

2011-10-27 Thread Bernd Petrovitsch
there (e.g. dmalloc) which may have far less impact on the systems performance. Depending on the skill, time and desperation level, building an (somewhat old) gcc with an applied bounds-checking patch may help more (but you may also run in Heisenberg-problems ). Bernd -- Bernd

Re: Problem with a UDP server implements

2011-10-19 Thread Bernd Petrovitsch
to fill in Ooops, forgot that we need the destination address of the received packet too to construct the answer for it. Then yes, it seems that you would need the raw packet on the receiving side too. [ Full quote deelted ] Bernd -- Bernd Petrovitsch Email

Re: Problem with a UDP server implements

2011-10-18 Thread Bernd Petrovitsch
. [...] Will it cause performance problem, compare to SOCK_DGRAM? IMHO that won't measurably - either user-space constructs the UDP and IP header or the kernel does. And we talk about a few bytes only. [ Don't top-post. ] Bernd -- Bernd Petrovitsch Email

Re: Prevent a process from opening a file more than once

2011-09-28 Thread Bernd Petrovitsch
the same process) and there is AFAIK no way to even detect that - let alone disallow it. And after a fork(), it's more or less the same (except that the open file descriptors belong to different processes ). Generally, I wonder why that is even necessary. Bernd -- Bernd Petrovitsch

Re: about gcc-3.4.6

2011-08-12 Thread Bernd Petrovitsch
On Fri, 2011-08-12 at 02:49 +0200, Javier Martinez Canillas wrote: On Fri, Jul 29, 2011 at 4:22 PM, esmaeil mirzaee esmaeil.deb...@gmail.com wrote: On Fri, Jul 29, 2011 at 8:16 AM, Bernd Petrovitsch be...@petrovitsch.priv.at wrote: On Fre, 2011-07-29 at 08:01 -0400, esmaeil mirzaee wrote

Re: about gcc-3.4.6

2011-07-29 Thread Bernd Petrovitsch
.//gcc.gnu.org/ or - surpise! - via Google. Again I'm so sorry for interrupt. No, you are not. Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at ___ Kernelnewbies

Re: questions for Linus

2011-05-31 Thread Bernd Petrovitsch
, or the devel one... It is now much simpler - all are stable. Alas, as with all man made stuff, some are more stable than others. Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at

Re: why only C?

2011-04-04 Thread Bernd Petrovitsch
Hi! On Mon, 2011-04-04 at 06:00 +0530, Chaitannya Mahatme wrote: On Monday 04 April 2011 01:19 AM, Bernd Petrovitsch wrote: [...] On Mon, 2011-04-04 at 00:47 +0530, mohit verma wrote: [] As far as i can decipher , we impose Object oriented paradigm in kernel space using C

Re: Common signal handler system call

2011-03-19 Thread Bernd Petrovitsch
to work on this tiny problem. :) What is the semantic of an error? At least one signal registration fails or all failed or some failed? And what is the application expected to do if it actually failed (for whatever reason). But feel free to implement it and play around! Bernd -- Bernd

Re: avoid ip forward replaces the source MAC address

2011-02-02 Thread Bernd Petrovitsch
layer 3) but switch only (on MAC level/OSI layer 2). Of course that has other implications and can't be done always ... Bernd -- Bernd Petrovitsch Email : be...@petrovitsch.priv.at LUGA : http://www.luga.at