1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

add ptmx support to test-container

This commit is contained in:
DJ Delorie
2025-03-14 16:08:12 -04:00
parent 7f163bd210
commit 81e74c8676
4 changed files with 67 additions and 0 deletions

View File

@@ -1151,6 +1151,9 @@ main (int argc, char **argv)
devmount (new_root_path, "null");
devmount (new_root_path, "zero");
devmount (new_root_path, "urandom");
#ifdef __linux__
devmount (new_root_path, "ptmx");
#endif
/* We're done with the "old" root, switch to the new one. */
if (chroot (new_root_path) < 0)
@@ -1217,6 +1220,14 @@ main (int argc, char **argv)
maybe_xmkdir ("/tmp", 0755);
#ifdef __linux__
maybe_xmkdir ("/dev/pts", 0777);
if (mount ("/dev/pts", "/dev/pts", "devpts", 0, "newinstance,ptmxmode=0666,mode=0666") < 0)
FAIL_EXIT1 ("can't mount /dev/pts: %m\n");
if (mount ("/dev/pts/ptmx", "/dev/ptmx", "", MS_BIND | MS_REC, NULL) < 0)
FAIL_EXIT1 ("can't mount /dev/ptmx\n");
#endif
if (require_pidns)
{
/* Now that we're pid 1 (effectively "root") we can mount /proc */