# Arabic translation of manpages # This file is distributed under the same license as the manpages-l10n package. # Copyright © of this file: # زايد السعيدي , 2026. msgid "" msgstr "" "Project-Id-Version: manpages-l10n 4.30.2\n" "POT-Creation-Date: 2026-06-05 06:35+0200\n" "PO-Revision-Date: 2026-05-18 17:58+0400\n" "Last-Translator: Zayed Al-Saidi \n" "Language-Team: Arabic \n" "Language: ar\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " "&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" "X-Generator: Lokalize 23.08.5\n" #. type: TH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "pivot_root" msgstr "pivot_root" #. type: TH #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "2026-02-08" msgstr "8 فبراير 2026" #. type: TH #: archlinux debian-unstable #, no-wrap msgid "Linux man-pages 6.18" msgstr "صفحات دليل لينكس 6.18" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "الاسم" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "pivot_root - change the root mount" msgstr "pivot_root - تغيير نقطة الوصل الجذرية" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "LIBRARY" msgstr "المكتبة" #. type: Plain text #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron #: opensuse-leap-16-1 opensuse-tumbleweed msgid "Standard C library (I,\\ I<-lc>)" msgstr "مكتبة سي المعيارية (I،\\ I<-lc>)" #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "SYNOPSIS" msgstr "موجز" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "B<#include Esys/syscall.hE> /* Definition of B constants */\n" "B<#include Eunistd.hE>\n" msgstr "" "B<#include Esys/syscall.hE> /* تعريف ثوابت B */\n" "B<#include Eunistd.hE>\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "BIB<, const char *>IB<);>\n" msgstr "BIB<, const char *>IB<);>\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I: glibc provides no wrapper for B(), necessitating the " "use of B(2)." msgstr "" "I<ملاحظة>: لا توفر glibc غلافًا لـ B()، مما يستلزم استخدام " "B(2)." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "الوصف" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B() changes the root mount in the mount namespace of the " "calling process. More precisely, it moves the root mount to the directory " "I and makes I the new root mount. The calling process " "must have the B capability in the user namespace that owns " "the caller's mount namespace." msgstr "" "يغير B() نقطة الوصل الجذرية في مساحة أسماء الوصل الخاصة بالعملية " "المستدعية. بشكل أدق، ينقل نقطة الوصل الجذرية إلى الدليل I ويجعل " "I نقطة الوصل الجذرية الجديدة. يجب أن تمتلك العملية المستدعية " "إمكانية B في مساحة أسماء المستخدم التي تمتلك مساحة أسماء " "الوصل الخاصة بالمستدعي." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "B() changes the root directory and the current working " "directory of each process or thread in the same mount namespace to " "I if they point to the old root directory. (See also NOTES.) On " "the other hand, B() does not change the caller's current " "working directory (unless it is on the old root directory), and thus it " "should be followed by a I call." msgstr "" "يغير B() الدليل الجذري ودليل العمل الحالي لكل عملية أو خيط في " "نفس مساحة أسماء الوصل إلى I إذا كانا يشيران إلى الدليل الجذري " "القديم. (انظر أيضًا الملاحظات.) من ناحية أخرى، لا يغير B() دليل " "العمل الحالي للمستدعي (إلا إذا كان على الدليل الجذري القديم)، وبالتالي يجب " "أن يتبعه استدعاء I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The following restrictions apply:" msgstr "تنطبق القيود التالية:" #. type: IP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "\\[bu]" msgstr "\\[bu]" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I and I must be directories." msgstr "يجب أن يكون I و I دليلين." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I and I must not be on the same mount as the current root." msgstr "" "يجب ألا يكون I و I على نفس نقطة الوصل مثل الجذر الحالي." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed msgid "" "I must be at or underneath I; that is, adding some " "nonnegative number of \\[dq]I\\[dq] suffixes to the pathname pointed " "to by I must yield the same directory as I." msgstr "" "يجب أن يكون I عند أو أسفل I؛ أي أن إضافة عدد غير سالب من " "اللواحق \\[dq]I\\[dq] إلى اسم المسار المشار إليه بواسطة I " "يجب أن ينتج نفس الدليل مثل I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I must be a path to a mount point, but can't be I<\\[dq]/\\[dq]>. " "A path that is not already a mount point can be converted into one by bind " "mounting the path onto itself." msgstr "" "يجب أن يكون I مسارًا إلى نقطة وصل، لكن لا يمكن أن يكون I<\\[dq]/" "\\[dq]>. يمكن تحويل مسار ليس بالفعل نقطة وصل إلى واحدة عن طريق وصل ربط " "المسار على نفسه." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The propagation type of the parent mount of I and the parent mount " "of the current root directory must not be B; similarly, if " "I is an existing mount point, its propagation type must not be " "B. These restrictions ensure that B() never " "propagates any changes to another mount namespace." msgstr "" "يجب ألا يكون نوع الانتشار لنقطة الوصل الأم لـ I ونقطة الوصل الأم " "للدليل الجذري الحالي B؛ وبالمثل، إذا كان I نقطة وصل " "موجودة، يجب ألا يكون نوع انتشارها B. تضمن هذه القيود أن " "B() لا ينشر أي تغييرات أبدًا إلى مساحة أسماء وصل أخرى." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The current root directory must be a mount point." msgstr "يجب أن يكون الدليل الجذري الحالي نقطة وصل." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "RETURN VALUE" msgstr "قيمة الإرجاع" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "On success, zero is returned. On error, -1 is returned, and I is set " "to indicate the error." msgstr "" "عند النجاح، يُعاد الصفر. وعند حدوث خطأ، يُعاد الرقم -1، ويُضبط I للإشارة " "إلى الخطأ." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "ERRORS" msgstr "الأخطاء" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B() may fail with any of the same errors as B(2). " "Additionally, it may fail with the following errors:" msgstr "" "قد يفشل B() مع أي من نفس الأخطاء مثل B(2). بالإضافة إلى " "ذلك، قد يفشل مع الأخطاء التالية:" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. #-#-#-#-# archlinux: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-# #. Reconfirmed that the following error occurs on Linux 5.0 by #. specifying 'new_root' as "/rootfs" and 'put_old' as #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of #. itself. Of course, this is an odd situation, since a later check #. in the kernel code will in any case yield EINVAL if 'new_root' is #. not a mount point. However, when the system call was first added, #. 'new_root' was not required to be a mount point. So, this #. error is nowadays probably just the result of crufty accumulation. #. This error can also occur if we bind mount "/" on top of itself #. and try to specify "/" as the 'new' (again, an odd situation). So, #. the EBUSY check in the kernel does still seem necessary to prevent #. that case. Furthermore, the "or put_old" piece is probably #. redundant text (although the check is in the kernel), since, #. in another check, 'put_old' is required to be under 'new_root'. #. type: Plain text #. #-#-#-#-# debian-trixie: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-# #. Reconfirmed that the following error occurs on Linux 5.0 by #. specifying 'new_root' as "/rootfs" and 'put_old' as #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of #. itself. Of course, this is an odd situation, since a later check #. in the kernel code will in any case yield EINVAL if 'new_root' is #. not a mount point. However, when the system call was first added, #. 'new_root' was not required to be a mount point. So, this #. error is nowadays probably just the result of crufty accumulation. #. This error can also occur if we bind mount "/" on top of itself #. and try to specify "/" as the 'new' (again, an odd situation). So, #. the EBUSY check in the kernel does still seem necessary to prevent #. that case. Furthermore, the "or put_old" piece is probably #. redundant text (although the check is in the kernel), since, #. in another check, 'put_old' is required to be under 'new_root'. #. type: Plain text #. #-#-#-#-# debian-unstable: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-# #. Reconfirmed that the following error occurs on Linux 5.0 by #. specifying 'new_root' as "/rootfs" and 'put_old' as #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of #. itself. Of course, this is an odd situation, since a later check #. in the kernel code will in any case yield EINVAL if 'new_root' is #. not a mount point. However, when the system call was first added, #. 'new_root' was not required to be a mount point. So, this #. error is nowadays probably just the result of crufty accumulation. #. This error can also occur if we bind mount "/" on top of itself #. and try to specify "/" as the 'new' (again, an odd situation). So, #. the EBUSY check in the kernel does still seem necessary to prevent #. that case. Furthermore, the "or put_old" piece is probably #. redundant text (although the check is in the kernel), since, #. in another check, 'put_old' is required to be under 'new_root'. #. type: Plain text #. #-#-#-#-# fedora-44: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-# #. Reconfirmed that the following error occurs on Linux 5.0 by #. specifying 'new_root' as "/rootfs" and 'put_old' as #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of #. itself. Of course, this is an odd situation, since a later check #. in the kernel code will in any case yield EINVAL if 'new_root' is #. not a mount point. However, when the system call was first added, #. 'new_root' was not required to be a mount point. So, this #. error is nowadays probably just the result of crufty accumulation. #. This error can also occur if we bind mount "/" on top of itself #. and try to specify "/" as the 'new' (again, an odd situation). So, #. the EBUSY check in the kernel does still seem necessary to prevent #. that case. Furthermore, the "or put_old" piece is probably #. redundant text (although the check is in the kernel), since, #. in another check, 'put_old' is required to be under 'new_root'. #. type: Plain text #. #-#-#-#-# fedora-rawhide: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-# #. Reconfirmed that the following error occurs on Linux 5.0 by #. specifying 'new_root' as "/rootfs" and 'put_old' as #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of #. itself. Of course, this is an odd situation, since a later check #. in the kernel code will in any case yield EINVAL if 'new_root' is #. not a mount point. However, when the system call was first added, #. 'new_root' was not required to be a mount point. So, this #. error is nowadays probably just the result of crufty accumulation. #. This error can also occur if we bind mount "/" on top of itself #. and try to specify "/" as the 'new' (again, an odd situation). So, #. the EBUSY check in the kernel does still seem necessary to prevent #. that case. Furthermore, the "or put_old" piece is probably #. redundant text (although the check is in the kernel), since, #. in another check, 'put_old' is required to be under 'new_root'. #. type: Plain text #. #-#-#-#-# mageia-cauldron: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-# #. Reconfirmed that the following error occurs on Linux 5.0 by #. specifying 'new_root' as "/rootfs" and 'put_old' as #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of #. itself. Of course, this is an odd situation, since a later check #. in the kernel code will in any case yield EINVAL if 'new_root' is #. not a mount point. However, when the system call was first added, #. 'new_root' was not required to be a mount point. So, this #. error is nowadays probably just the result of crufty accumulation. #. This error can also occur if we bind mount "/" on top of itself #. and try to specify "/" as the 'new' (again, an odd situation). So, #. the EBUSY check in the kernel does still seem necessary to prevent #. that case. Furthermore, the "or put_old" piece is probably #. redundant text (although the check is in the kernel), since, #. in another check, 'put_old' is required to be under 'new_root'. #. type: Plain text #. #-#-#-#-# opensuse-leap-16-1: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-# #. Reconfirmed that the following error occurs on Linux 5.0 by #. specifying 'new_root' as "/rootfs" and 'put_old' as #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of #. itself. Of course, this is an odd situation, since a later check #. in the kernel code will in any case yield EINVAL if 'new_root' is #. not a mount point. However, when the system call was first added, #. 'new_root' was not required to be a mount point. So, this #. error is nowadays probably just the result of crufty accumulation. #. This error can also occur if we bind mount "/" on top of itself #. and try to specify "/" as the 'new' (again, an odd situation). So, #. the EBUSY check in the kernel does still seem necessary to prevent #. that case. Furthermore, the "or put_old" piece is probably #. redundant text (although the check is in the kernel), since, #. in another check, 'put_old' is required to be under 'new_root'. #. type: Plain text #. #-#-#-#-# opensuse-tumbleweed: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-# #. Reconfirmed that the following error occurs on Linux 5.0 by #. specifying 'new_root' as "/rootfs" and 'put_old' as #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of #. itself. Of course, this is an odd situation, since a later check #. in the kernel code will in any case yield EINVAL if 'new_root' is #. not a mount point. However, when the system call was first added, #. 'new_root' was not required to be a mount point. So, this #. error is nowadays probably just the result of crufty accumulation. #. This error can also occur if we bind mount "/" on top of itself #. and try to specify "/" as the 'new' (again, an odd situation). So, #. the EBUSY check in the kernel does still seem necessary to prevent #. that case. Furthermore, the "or put_old" piece is probably #. redundant text (although the check is in the kernel), since, #. in another check, 'put_old' is required to be under 'new_root'. #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I or I is on the current root mount. (This error covers " "the pathological case where I is I<\\[dq]/\\[dq]>.)" msgstr "" "I أو I على نقطة الوصل الجذرية الحالية. (يغطي هذا الخطأ " "الحالة المرضية حيث I هو I<\\[dq]/\\[dq]>.)" #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I is not a mount point." msgstr "I ليس نقطة وصل." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I is not at or underneath I." msgstr "I ليس عند أو أسفل I." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The current root directory is not a mount point (because of an earlier " "B(2))." msgstr "الدليل الجذري الحالي ليس نقطة وصل (بسبب B(2) سابق)." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The current root is on the rootfs (initial ramfs) mount; see NOTES." msgstr "الجذر الحالي على نقطة وصل rootfs (ramfs الأولية)؛ انظر الملاحظات." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "Either the mount point at I, or the parent mount of that mount " "point, has propagation type B." msgstr "" "إما نقطة الوصل عند I، أو نقطة الوصل الأم لتلك النقطة، لها نوع " "انتشار B." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I is a mount point and has the propagation type B." msgstr "I هو نقطة وصل وله نوع انتشار B." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "I or I is not a directory." msgstr "I أو I ليس دليلاً." #. type: TP #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "The calling process does not have the B capability." msgstr "لا تمتلك العملية المستدعية إمكانية B." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "STANDARDS" msgstr "المعايير" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Linux." msgstr "لينكس." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "HISTORY" msgstr "التاريخ" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "Linux 2.3.41." msgstr "لينكس 2.3.41." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "NOTES" msgstr "ملاحظات" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "A command-line interface for this system call is provided by " "B(8)." msgstr "توفر B(8) واجهة سطر أوامر لاستدعاء النظام هذا." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B() allows the caller to switch to a new root filesystem while " "at the same time placing the old root mount at a location under I " "from where it can subsequently be unmounted. (The fact that it moves all " "processes that have a root directory or current working directory on the old " "root directory to the new root frees the old root directory of users, " "allowing the old root mount to be unmounted more easily.)" msgstr "" "يسمح B() للمستدعي بالتبديل إلى نظام ملفات جذري جديد مع وضع نقطة " "الوصل الجذرية القديمة في موقع تحت I حيث يمكن فصلها لاحقًا. (حقيقة " "أنه ينقل جميع العمليات التي لديها دليل جذري أو دليل عمل حالي على الدليل " "الجذري القديم إلى الجذر الجديد يحرر الدليل الجذري القديم من المستخدمين، مما " "يسمح بفصل نقطة الوصل الجذرية القديمة بسهولة أكبر.)" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "One use of B() is during system startup, when the system mounts " "a temporary root filesystem (e.g., an B(4)), then mounts the real " "root filesystem, and eventually turns the latter into the root directory of " "all relevant processes and threads. A modern use is to set up a root " "filesystem during the creation of a container." msgstr "" "أحد استخدامات B() هو أثناء بدء تشغيل النظام، عندما يقوم النظام " "بوصل نظام ملفات جذري مؤقت (مثل B(4))، ثم يصل نظام الملفات الجذري " "الحقيقي، ويحول الأخير في النهاية إلى الدليل الجذري لجميع العمليات والخيوط " "ذات الصلة. استخدام حديث هو إعداد نظام ملفات جذري أثناء إنشاء حاوية." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The fact that B() modifies process root and current working " "directories in the manner noted in DESCRIPTION is necessary in order to " "prevent kernel threads from keeping the old root mount busy with their root " "and current working directories, even if they never access the filesystem in " "any way." msgstr "" "حقيقة أن B() يعدل الدلائل الجذرية ودلائل العمل الحالية للعمليات " "بالطريقة المذكورة في الوصف ضرورية لمنع خيوط النواة من إبقاء نقطة الوصل " "الجذرية القديمة مشغولة بدلائلها الجذرية ودلائل العمل الحالية، حتى لو لم تصل " "إلى نظام الملفات بأي شكل." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The rootfs (initial ramfs) cannot be B()ed. The recommended " "method of changing the root filesystem in this case is to delete everything " "in rootfs, overmount rootfs with the new root, attach I/I/" "I to the new I, and exec the new B(1). Helper " "programs for this process exist; see B(8)." msgstr "" "لا يمكن تطبيق B() على rootfs (ramfs الأولية). الطريقة الموصى " "بها لتغيير نظام الملفات الجذري في هذه الحالة هي حذف كل شيء في rootfs، ووصل " "rootfs فوقه بالجذر الجديد، وإرفاق I/I/I بـ I الجديد، وتنفيذ B(1) الجديد. توجد برامج مساعدة لهذه العملية؛ " "انظر B(8)." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "pivot_root(\\[dq].\\[dq], \\[dq].\\[dq])" msgstr "pivot_root(\\[dq].\\[dq], \\[dq].\\[dq])" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "I and I may be the same directory. In particular, the " "following sequence allows a pivot-root operation without needing to create " "and remove a temporary directory:" msgstr "" "يمكن أن يكون I و I نفس الدليل. على وجه الخصوص، يسمح " "التسلسل التالي بعملية pivot-root دون الحاجة إلى إنشاء وإزالة دليل مؤقت:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "" "chdir(new_root);\n" "pivot_root(\".\", \".\");\n" "umount2(\".\", MNT_DETACH);\n" msgstr "" "chdir(new_root);\n" "pivot_root(\".\", \".\");\n" "umount2(\".\", MNT_DETACH);\n" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This sequence succeeds because the B() call stacks the old root " "mount point on top of the new root mount point at I. At that point, the " "calling process's root directory and current working directory refer to the " "new root mount point (I). During the subsequent B() " "call, resolution of I<\\[dq].\\[dq]> starts with I and then moves " "up the list of mounts stacked at I, with the result that old root mount " "point is unmounted." msgstr "" "ينجح هذا التسلسل لأن استدعاء B() يكدس نقطة وصل الجذر القديم فوق " "نقطة وصل الجذر الجديد في I. في تلك النقطة، يشير دليل الجذر ودليل العمل " "الحالي لعملية الاستدعاء إلى نقطة وصل الجذر الجديد (I). أثناء " "استدعاء B() اللاحق، يبدأ تحليل I<\\[dq].\\[dq]> من I ثم " "يتحرك لأعلى قائمة الوصلات المكدسة في I، مما يؤدي إلى فك وصل نقطة وصل " "الجذر القديم." #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Historical notes" msgstr "ملاحظات تاريخية" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "For many years, this manual page carried the following text:" msgstr "لسنوات عديدة، حملت صفحة الدليل هذه النص التالي:" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B() may or may not change the current root and the current " "working directory of any processes or threads which use the old root " "directory. The caller of B() must ensure that processes with " "root or current working directory at the old root operate correctly in " "either case. An easy way to ensure this is to change their root and current " "working directory to I before invoking B()." msgstr "" "قد يغير B() أو لا يغير الجذر الحالي ودليل العمل الحالي لأي " "عمليات أو خيوط تستخدم دليل الجذر القديم. يجب على مستدعي B() " "التأكد من أن العمليات التي لها جذر أو دليل عمل حالي في الجذر القديم تعمل " "بشكل صحيح في كلتا الحالتين. طريقة سهلة لضمان ذلك هي تغيير جذرها ودليل عملها " "الحالي إلى I قبل استدعاء B()." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "This text, written before the system call implementation was even finalized " "in the kernel, was probably intended to warn users at that time that the " "implementation might change before final release. However, the behavior " "stated in DESCRIPTION has remained consistent since this system call was " "first implemented and will not change now." msgstr "" "هذا النص، الذي كتب قبل حتى الانتهاء من تنفيذ استدعاء النظام في النواة، ربما " "كان يهدف إلى تحذير المستخدمين في ذلك الوقت بأن التنفيذ قد يتغير قبل الإصدار " "النهائي. ومع ذلك، ظل السلوك المذكور في الوصف ثابتًا منذ تنفيذ استدعاء النظام " "هذا لأول مرة ولن يتغير الآن." #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "EXAMPLES" msgstr "أمثلة" #. FIXME #. Would it be better, because simpler, to use unshare(2) #. rather than clone(2) in the example below? #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "The program below demonstrates the use of B() inside a mount " "namespace that is created using B(2). After pivoting to the root " "directory named in the program's first command-line argument, the child " "created by B(2) then executes the program named in the remaining " "command-line arguments." msgstr "" "يوضح البرنامج أدناه استخدام B() داخل مساحة اسم وصل تم إنشاؤها " "باستخدام B(2). بعد التمحور إلى دليل الجذر المسمى في وسيطة سطر الأوامر " "الأولى للبرنامج، ينفذ الطفل الذي أنشأه B(2) البرنامج المسمى في وسيطات " "سطر الأوامر المتبقية." #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "We demonstrate the program by creating a directory that will serve as the " "new root filesystem and placing a copy of the (statically linked) " "B(1) executable in that directory." msgstr "" "نوضح البرنامج عن طريق إنشاء دليل سيعمل كنظام ملفات جذر جديد ووضع نسخة من " "الملف التنفيذي B(1) (المرتبط بشكل ثابت) في ذلك الدليل." #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "$B< mkdir /tmp/rootfs>;\n" "$B< ls -id /tmp/rootfs>; # Show inode number of new root directory\n" "319459 /tmp/rootfs\n" "$B< cp $(which busybox) /tmp/rootfs>;\n" "$B< PS1=\\[aq]bbsh$ \\[aq] sudo ./pivot_root_demo /tmp/rootfs /busybox sh>;\n" "bbsh$B< PATH=/>;\n" "bbsh$B< busybox ln busybox ln>;\n" "bbsh$B< ln busybox echo>;\n" "bbsh$B< ln busybox ls>;\n" "bbsh$B< ls>;\n" "busybox echo ln ls\n" "bbsh$B< ls -id />; # Compare with inode number above\n" "319459 /\n" "bbsh$B< echo \\[aq]hello world\\[aq]>;\n" "hello world\n" msgstr "" "$B< mkdir /tmp/rootfs>;\n" "$B< ls -id /tmp/rootfs>; # Show inode number of new root directory\n" "319459 /tmp/rootfs\n" "$B< cp $(which busybox) /tmp/rootfs>;\n" "$B< PS1=\\[aq]bbsh$ \\[aq] sudo ./pivot_root_demo /tmp/rootfs /busybox sh>;\n" "bbsh$B< PATH=/>;\n" "bbsh$B< busybox ln busybox ln>;\n" "bbsh$B< ln busybox echo>;\n" "bbsh$B< ln busybox ls>;\n" "bbsh$B< ls>;\n" "busybox echo ln ls\n" "bbsh$B< ls -id />; # Compare with inode number above\n" "319459 /\n" "bbsh$B< echo \\[aq]hello world\\[aq]>;\n" "hello world\n" #. type: SS #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Program source" msgstr "مصدر البرنامج" #. type: Plain text #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 #: opensuse-tumbleweed #, no-wrap msgid "" "/* pivot_root_demo.c */\n" "\\&\n" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Elimits.hE\n" "#include Esched.hE\n" "#include Esignal.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Esys/mman.hE\n" "#include Esys/mount.hE\n" "#include Esys/stat.hE\n" "#include Esys/syscall.hE\n" "#include Esys/wait.hE\n" "#include Eunistd.hE\n" "\\&\n" "static int\n" "pivot_root(const char *new_root, const char *put_old)\n" "{\n" " return syscall(SYS_pivot_root, new_root, put_old);\n" "}\n" "\\&\n" "#define STACK_SIZE (1024 * 1024)\n" "\\&\n" "static int /* Startup function for cloned child */\n" "child(void *arg)\n" "{\n" " char path[PATH_MAX];\n" " char **args = arg;\n" " char *new_root = args[0];\n" " const char *put_old = \"/oldrootfs\";\n" "\\&\n" " /* Ensure that \\[aq]new_root\\[aq] and its parent mount don\\[aq]t have\n" " shared propagation (which would cause pivot_root() to\n" " return an error), and prevent propagation of mount\n" " events to the initial mount namespace. */\n" "\\&\n" " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n" " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n" "\\&\n" " /* Ensure that \\[aq]new_root\\[aq] is a mount point. */\n" "\\&\n" " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n" " err(EXIT_FAILURE, \"mount-MS_BIND\");\n" "\\&\n" " /* Create directory to which old root will be pivoted. */\n" "\\&\n" " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n" " if (mkdir(path, 0777) == -1)\n" " err(EXIT_FAILURE, \"mkdir\");\n" "\\&\n" " /* And pivot the root filesystem. */\n" "\\&\n" " if (pivot_root(new_root, path) == -1)\n" " err(EXIT_FAILURE, \"pivot_root\");\n" "\\&\n" " /* Switch the current working directory to \"/\". */\n" "\\&\n" " if (chdir(\"/\") == -1)\n" " err(EXIT_FAILURE, \"chdir\");\n" "\\&\n" " /* Unmount old root and remove mount point. */\n" "\\&\n" " if (umount2(put_old, MNT_DETACH) == -1)\n" " perror(\"umount2\");\n" " if (rmdir(put_old) == -1)\n" " perror(\"rmdir\");\n" "\\&\n" " /* Execute the command specified in argv[1]... */\n" "\\&\n" " execv(args[1], &args[1]);\n" " err(EXIT_FAILURE, \"execv\");\n" "}\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " char *stack;\n" "\\&\n" " /* Create a child process in a new mount namespace. */\n" "\\&\n" " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n" " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n" " if (stack == MAP_FAILED)\n" " err(EXIT_FAILURE, \"mmap\");\n" "\\&\n" " if (clone(child, stack + STACK_SIZE,\n" " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n" " err(EXIT_FAILURE, \"clone\");\n" "\\&\n" " /* Parent falls through to here; wait for child. */\n" "\\&\n" " if (wait(NULL) == -1)\n" " err(EXIT_FAILURE, \"wait\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "/* pivot_root_demo.c */\n" "\\&\n" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Elimits.hE\n" "#include Esched.hE\n" "#include Esignal.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Esys/mman.hE\n" "#include Esys/mount.hE\n" "#include Esys/stat.hE\n" "#include Esys/syscall.hE\n" "#include Esys/wait.hE\n" "#include Eunistd.hE\n" "\\&\n" "static int\n" "pivot_root(const char *new_root, const char *put_old)\n" "{\n" " return syscall(SYS_pivot_root, new_root, put_old);\n" "}\n" "\\&\n" "#define STACK_SIZE (1024 * 1024)\n" "\\&\n" "static int /* Startup function for cloned child */\n" "child(void *arg)\n" "{\n" " char path[PATH_MAX];\n" " char **args = arg;\n" " char *new_root = args[0];\n" " const char *put_old = \"/oldrootfs\";\n" "\\&\n" " /* Ensure that \\[aq]new_root\\[aq] and its parent mount don\\[aq]t have\n" " shared propagation (which would cause pivot_root() to\n" " return an error), and prevent propagation of mount\n" " events to the initial mount namespace. */\n" "\\&\n" " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n" " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n" "\\&\n" " /* Ensure that \\[aq]new_root\\[aq] is a mount point. */\n" "\\&\n" " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n" " err(EXIT_FAILURE, \"mount-MS_BIND\");\n" "\\&\n" " /* Create directory to which old root will be pivoted. */\n" "\\&\n" " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n" " if (mkdir(path, 0777) == -1)\n" " err(EXIT_FAILURE, \"mkdir\");\n" "\\&\n" " /* And pivot the root filesystem. */\n" "\\&\n" " if (pivot_root(new_root, path) == -1)\n" " err(EXIT_FAILURE, \"pivot_root\");\n" "\\&\n" " /* Switch the current working directory to \"/\". */\n" "\\&\n" " if (chdir(\"/\") == -1)\n" " err(EXIT_FAILURE, \"chdir\");\n" "\\&\n" " /* Unmount old root and remove mount point. */\n" "\\&\n" " if (umount2(put_old, MNT_DETACH) == -1)\n" " perror(\"umount2\");\n" " if (rmdir(put_old) == -1)\n" " perror(\"rmdir\");\n" "\\&\n" " /* Execute the command specified in argv[1]... */\n" "\\&\n" " execv(args[1], &args[1]);\n" " err(EXIT_FAILURE, \"execv\");\n" "}\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " char *stack;\n" "\\&\n" " /* Create a child process in a new mount namespace. */\n" "\\&\n" " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n" " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n" " if (stack == MAP_FAILED)\n" " err(EXIT_FAILURE, \"mmap\");\n" "\\&\n" " if (clone(child, stack + STACK_SIZE,\n" " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n" " err(EXIT_FAILURE, \"clone\");\n" "\\&\n" " /* Parent falls through to here; wait for child. */\n" "\\&\n" " if (wait(NULL) == -1)\n" " err(EXIT_FAILURE, \"wait\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. SRC END #. type: SH #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "SEE ALSO" msgstr "انظر أيضًا" #. type: Plain text #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed msgid "" "B(2), B(2), B(2), B(2), B(4), " "B(7), B(8), B(8)" msgstr "" "B(2), B(2), B(2), B(2), B(4), " "B(7), B(8), B(8)" #. type: TH #: debian-trixie #, no-wrap msgid "2024-05-02" msgstr "2 مايو 2024" #. type: TH #: debian-trixie #, no-wrap msgid "Linux man-pages 6.9.1" msgstr "صفحات دليل لينكس 6.9.1" #. type: Plain text #: debian-trixie msgid "Standard C library (I, I<-lc>)" msgstr "مكتبة سي المعيارية (I، I<-lc>)" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "B() changes the root directory and the current working " "directory of each process or thread in the same mount namespace to " "I if they point to the old root directory. (See also NOTES.) On " "the other hand, B() does not change the caller's current " "working directory (unless it is on the old root directory), and thus it " "should be followed by a B call." msgstr "" "يغير B() دليل الجذر ودليل العمل الحالي لكل عملية أو خيط في نفس " "مساحة اسم الوصل إلى I إذا كانا يشيران إلى دليل الجذر القديم. (انظر " "أيضًا الملاحظات.) من ناحية أخرى، لا يغير B() دليل العمل الحالي " "للمستدعي (إلا إذا كان في دليل الجذر القديم)، وبالتالي يجب أن يتبعه استدعاء " "B." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide msgid "" "I must be at or underneath I; that is, adding some " "nonnegative number of \"I\" suffixes to the pathname pointed to by " "I must yield the same directory as I." msgstr "" "يجب أن يكون I في أو أسفل I؛ أي أن إضافة عدد غير سالب من " "اللواحق \"I\" إلى اسم المسار المشار إليه بواسطة I يجب أن ينتج " "نفس الدليل مثل I." #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, no-wrap msgid "" "$ B\n" "$ B # Show inode number of new root directory\n" "319459 /tmp/rootfs\n" "$ B\n" "$ B\n" "bbsh$ B\n" "bbsh$ B\n" "bbsh$ B\n" "bbsh$ B\n" "bbsh$ B\n" "busybox echo ln ls\n" "bbsh$ B # Compare with inode number above\n" "319459 /\n" "bbsh$ B\n" "hello world\n" msgstr "" "$ B\n" "$ B # Show inode number of new root directory\n" "319459 /tmp/rootfs\n" "$ B\n" "$ B\n" "bbsh$ B\n" "bbsh$ B\n" "bbsh$ B\n" "bbsh$ B\n" "bbsh$ B\n" "busybox echo ln ls\n" "bbsh$ B # Compare with inode number above\n" "319459 /\n" "bbsh$ B\n" "hello world\n" #. type: Plain text #: debian-trixie fedora-44 fedora-rawhide #, no-wrap msgid "" "/* pivot_root_demo.c */\n" "\\&\n" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Elimits.hE\n" "#include Esched.hE\n" "#include Esignal.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Esys/mman.hE\n" "#include Esys/mount.hE\n" "#include Esys/stat.hE\n" "#include Esys/syscall.hE\n" "#include Esys/wait.hE\n" "#include Eunistd.hE\n" "\\&\n" "static int\n" "pivot_root(const char *new_root, const char *put_old)\n" "{\n" " return syscall(SYS_pivot_root, new_root, put_old);\n" "}\n" "\\&\n" "#define STACK_SIZE (1024 * 1024)\n" "\\&\n" "static int /* Startup function for cloned child */\n" "child(void *arg)\n" "{\n" " char path[PATH_MAX];\n" " char **args = arg;\n" " char *new_root = args[0];\n" " const char *put_old = \"/oldrootfs\";\n" "\\&\n" " /* Ensure that \\[aq]new_root\\[aq] and its parent mount don\\[aq]t have\n" " shared propagation (which would cause pivot_root() to\n" " return an error), and prevent propagation of mount\n" " events to the initial mount namespace. */\n" "\\&\n" " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n" " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n" "\\&\n" " /* Ensure that \\[aq]new_root\\[aq] is a mount point. */\n" "\\&\n" " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n" " err(EXIT_FAILURE, \"mount-MS_BIND\");\n" "\\&\n" " /* Create directory to which old root will be pivoted. */\n" "\\&\n" " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n" " if (mkdir(path, 0777) == -1)\n" " err(EXIT_FAILURE, \"mkdir\");\n" "\\&\n" " /* And pivot the root filesystem. */\n" "\\&\n" " if (pivot_root(new_root, path) == -1)\n" " err(EXIT_FAILURE, \"pivot_root\");\n" "\\&\n" " /* Switch the current working directory to \"/\". */\n" "\\&\n" " if (chdir(\"/\") == -1)\n" " err(EXIT_FAILURE, \"chdir\");\n" "\\&\n" " /* Unmount old root and remove mount point. */\n" "\\&\n" " if (umount2(put_old, MNT_DETACH) == -1)\n" " perror(\"umount2\");\n" " if (rmdir(put_old) == -1)\n" " perror(\"rmdir\");\n" "\\&\n" " /* Execute the command specified in argv[1]... */\n" "\\&\n" " execv(args[1], &args[1]);\n" " err(EXIT_FAILURE, \"execv\");\n" "}\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " char *stack;\n" "\\&\n" " /* Create a child process in a new mount namespace. */\n" "\\&\n" " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n" " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n" " if (stack == MAP_FAILED)\n" " err(EXIT_FAILURE, \"mmap\");\n" "\\&\n" " if (clone(child, stack + STACK_SIZE,\n" " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n" " err(EXIT_FAILURE, \"clone\");\n" "\\&\n" " /* Parent falls through to here; wait for child. */\n" "\\&\n" " if (wait(NULL) == -1)\n" " err(EXIT_FAILURE, \"wait\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "/* pivot_root_demo.c */\n" "\\&\n" "#define _GNU_SOURCE\n" "#include Eerr.hE\n" "#include Elimits.hE\n" "#include Esched.hE\n" "#include Esignal.hE\n" "#include Estdio.hE\n" "#include Estdlib.hE\n" "#include Esys/mman.hE\n" "#include Esys/mount.hE\n" "#include Esys/stat.hE\n" "#include Esys/syscall.hE\n" "#include Esys/wait.hE\n" "#include Eunistd.hE\n" "\\&\n" "static int\n" "pivot_root(const char *new_root, const char *put_old)\n" "{\n" " return syscall(SYS_pivot_root, new_root, put_old);\n" "}\n" "\\&\n" "#define STACK_SIZE (1024 * 1024)\n" "\\&\n" "static int /* Startup function for cloned child */\n" "child(void *arg)\n" "{\n" " char path[PATH_MAX];\n" " char **args = arg;\n" " char *new_root = args[0];\n" " const char *put_old = \"/oldrootfs\";\n" "\\&\n" " /* Ensure that \\[aq]new_root\\[aq] and its parent mount don\\[aq]t have\n" " shared propagation (which would cause pivot_root() to\n" " return an error), and prevent propagation of mount\n" " events to the initial mount namespace. */\n" "\\&\n" " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n" " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n" "\\&\n" " /* Ensure that \\[aq]new_root\\[aq] is a mount point. */\n" "\\&\n" " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n" " err(EXIT_FAILURE, \"mount-MS_BIND\");\n" "\\&\n" " /* Create directory to which old root will be pivoted. */\n" "\\&\n" " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n" " if (mkdir(path, 0777) == -1)\n" " err(EXIT_FAILURE, \"mkdir\");\n" "\\&\n" " /* And pivot the root filesystem. */\n" "\\&\n" " if (pivot_root(new_root, path) == -1)\n" " err(EXIT_FAILURE, \"pivot_root\");\n" "\\&\n" " /* Switch the current working directory to \"/\". */\n" "\\&\n" " if (chdir(\"/\") == -1)\n" " err(EXIT_FAILURE, \"chdir\");\n" "\\&\n" " /* Unmount old root and remove mount point. */\n" "\\&\n" " if (umount2(put_old, MNT_DETACH) == -1)\n" " perror(\"umount2\");\n" " if (rmdir(put_old) == -1)\n" " perror(\"rmdir\");\n" "\\&\n" " /* Execute the command specified in argv[1]... */\n" "\\&\n" " execv(args[1], &args[1]);\n" " err(EXIT_FAILURE, \"execv\");\n" "}\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " char *stack;\n" "\\&\n" " /* Create a child process in a new mount namespace. */\n" "\\&\n" " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n" " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n" " if (stack == MAP_FAILED)\n" " err(EXIT_FAILURE, \"mmap\");\n" "\\&\n" " if (clone(child, stack + STACK_SIZE,\n" " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n" " err(EXIT_FAILURE, \"clone\");\n" "\\&\n" " /* Parent falls through to here; wait for child. */\n" "\\&\n" " if (wait(NULL) == -1)\n" " err(EXIT_FAILURE, \"wait\");\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. type: TH #: fedora-44 fedora-rawhide #, no-wrap msgid "2024-07-23" msgstr "23 يوليو 2024" #. type: TH #: fedora-44 fedora-rawhide #, no-wrap msgid "Linux man-pages 6.13" msgstr "صفحات دليل لينكس 6.13" #. type: TH #: mageia-cauldron #, no-wrap msgid "Linux man-pages 6.17" msgstr "صفحات دليل لينكس 6.17" #. type: TH #: opensuse-leap-16-1 opensuse-tumbleweed #, no-wrap msgid "Linux man-pages (unreleased)" msgstr "صفحات دليل لينكس (لم تصدر بعد)"