Tag Info

Hot answers tagged

7

Your analysis so far is generally correct. The way a shell might set the stdin of a process to a pipe descriptor could be (pseudocode): pipe(p) // create a new pipe with two handles p[0] and p[1] fork() // spawn a child process close(p[0]) // close the write end of the pipe in the child dup2(p[1], 0) // duplicate the pipe descriptor on top of fd 0 ...


4

Files in /proc do not have a file size in general, and are shown as having 0 size in ls -l, but you can read data from them anyway (see man 5 proc). Try, for example: zcat /proc/config.gz | wc or: $ ls -l /proc/cmdline -r--r--r-- 1 root root 0 Aug 4 10:16 /proc/cmdline Looks empty. But: $ cat /proc/cmdline | wc 1 5 114 it contains ...


2

A makefile recipe will stop executing if any command in it returns a failure status (unless the command is preceded by a -). The recipe you cited will ensure that /bsd only gets replaced if the cp bsd /nbsd command succeeds. The cp could fail if the partition were full or out of inodes.


1

Assuming you are using Ubuntu, apt-get install linux-manual-3.2 or similar (pick the correct version). There is also another documentation package apt-get install linux-doc but this is html.


1

The content is parsed directly (see also this) from the source .c files1: In order to provide embedded, 'C' friendly, easy to maintain, but consistent and extractable documentation of the functions and data structures in the Linux kernel, the Linux kernel has adopted a consistent style for documenting functions and their parameters, and ...


1

If you didn't have an initramfs, you could do it with kernel parameters. Just add a random string as kernel parameter and then use /proc/cmdline as the key for your encryption. If it's not easy to add such parameters to your boot loader, the Linux kernel has a CMDLINE config option that lets you compile it in. (Note: it is possible for kernel parameters to ...


1

You can't #include two headers with an identical path, but you can install one outside of the normal paths and have it supersede those when you compile by using the appropriate switch (for gcc, -I). I think you understand that stuff already, so it should not take too much thinking to recognize that you if you place more than one asm/fcntl.h in normal ...


1

This should involve some kind of emulation such as linprocfs that will allow you to run Linux binaries inside FreeBSD. I donĀ“t think that such technology exists, where you will be able to run Linux binaries inside XNU. However, you could give it a try on the PureDarwin software distribution, that is a Darwin compilation and it will allow you to user ...


1

kernel.org has some excellent documentation on Applying Patches to the Linux Kernel. Essentially, you use the patch command. Once you have acquired the patch (here called patchfile), place it in your build directory and then issue the command: patch -p <num> < patchfile where <num> is the number of leading slashes to remove from the ...


1

To change the NDP DAD timing, use sysctl. The sysctl-key to look at is net.ipv6.neigh.<if>.retrans_time_ms.


1

If you are using Buildroot, select a uImage kernel output file (BR2_LINUX_KERNEL_UIMAGE=y). Compile normally and Buildroot will also create a vmlinux file in an intermediate step. While the vmlinux file is not copied to the /output/images directory it can be found in ./output/build/linux-custom/(or by running find . -name "vmlinux").


1

Yes, there is a man page in section 5 "File formats and conventions": man 5 proc It is surprisingly long, though - it describes 189 kinds of files in /proc.



Only top voted, non community-wiki answers of a minimum length are eligible