Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\apparmor\apparmorfs.c Create Date:2022-07-28 19:49:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ns_revision_read

Proto:static ssize_t ns_revision_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
char __user *buf
size_tsize
loff_t *ppos
565  rev = needed for tty driver, and maybe others
570  mutex_lock_nested( & lock, level)
571  last_read = last_read
572  If last_read == revision Then
573  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
574  If f_flags & O_NONBLOCK Then Return -EAGAIN
576  If wait_event_interruptible - sleep until a condition gets true*@wq_head: the waitqueue to wait on*@condition: a C expression for the event to wait for* The process is put to sleep (TASK_INTERRUPTIBLE) until the(wait, last_read != READ_ONCE(revision)) Then Return -These should never be seen by user programs. To return one of ERESTART** codes, signal_pending() MUST be set. Note that ptrace can observe these* at syscall exit tracing, but they will never be left for the debugged user* process to see.
580  mutex_lock_nested( & lock, level)
583  avail = sprintf(buffer, "%ld\n", revision)
584  If ppos + size > avail Then
585  last_read = revision
586  ppos = 0
588  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
590  Return simple_read_from_buffer(buf, size, ppos, buffer, avail)