3 ms·
> docker uses the same kernel/glibc as the host Docker containers usesthe same kernel as the host, but the libc comes from the container.
by Denvercoder9 5y ago
> docker uses the same kernel/glibc as the host
Docker containers usesthe same kernel as the host, but the libc comes from the container.
- MichaelMoser123 5y agobut for syscalls libc calls down into the kernel; libc and the kernel are a pair of shoes.
- Denvercoder9 5y ago> libc and the kernel are a pair of shoes. Not really. The kernel obviously is compatible with older versions of libc, but glibc is also compatible with older kernel versions (down to 3.2 for the latest version), and it even attempts to emulate some system calls if your kernel doesn't support them. You've quite some freedom to mix versions.
- MichaelMoser123 5y agohere is the present source code for glibc where faccessat2 is used. What you say is true for some cases; if glibc is built for kernel versions below 0x050800 then it doesn't assume faccessat2, here it falls back to faccessat for some cases - and faccessat was added in 2.6.16. But if you have flags other than AT_SYMLINK_NOFOLLOW or AT_EACCESS the call just fails without doing the fallback. See https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270ed30fdbae9ad25426/sysdeps/unix/sysv/linux/faccessat.c#L36 https://github.com/bminor/glibc/blob/595c22ecd8e87a27fd19270... TIL that this this glibc mirror is kept in sync with the real one https://github.com/bminor/glibc https://github.com/bminor/glibc