Lines Matching full:current
34 macro_rules! current { macro
38 unsafe { &*$crate::task::Task::current() }
63 /// The following is an example of getting the PID of the current thread with zero additional cost
67 /// let pid = current!().pid();
70 /// Getting the PID of the current process, also zero additional cost:
73 /// let pid = current!().group_leader().pid();
76 /// Getting the current task and storing it in some struct. The reference count is automatically
90 /// creator: current!().into(),
99 // SAFETY: By design, the only way to access a `Task` is via the `current` function or via an
120 /// Returns a raw pointer to the current task.
125 // SAFETY: Getting the current pointer is always safe. in current_raw()
131 /// The recommended way to get the current task/thread is to use the
132 /// [`current`] macro because it is safe.
136 /// Callers must ensure that the returned object doesn't outlive the current task/thread.
137 pub unsafe fn current() -> impl Deref<Target = Task> { in current() method
151 let current = Task::current_raw(); in current() localVariable
153 // SAFETY: If the current thread is still running, the current task is valid. Given in current()
156 task: unsafe { &*current.cast() }, in current()
165 /// current task's/thread's pid namespace is to use the [`current_pid_ns`] macro because it is
170 /// Callers must ensure that the returned object doesn't outlive the current task/thread.
202 // (1) retrieving the `PidNamespace` of the `current` task in current_pid_ns()
203 // (2) retrieving the `PidNamespace` of a non-`current` task in current_pid_ns()
207 // `PidNamespace` after `release_task()` for current will return `NULL` but no codepath in current_pid_ns()
212 // must've been acquired while holding the RCU lock. Note that accessing a non-`current` in current_pid_ns()
213 // task means `NULL` can be returned as the non-`current` task could have already passed in current_pid_ns()
220 // Rust to handle the common case of accessing `current`'s `PidNamespace` without RCU in current_pid_ns()
239 // SAFETY: The current task's pid namespace is valid as long as the current task is running. in current_pid_ns()
242 // SAFETY: If the current thread is still running, the current task and its associated in current_pid_ns()
244 // transferred to another thread (where it could potentially outlive the current in current_pid_ns()
246 // current task/thread. in current_pid_ns()
345 /// Get the current euid.
366 /// Uses the namespace of the current task.