Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\apm_32.c Create Date:2022-07-28 08:22:31
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:do_ioctl

Proto:static long do_ioctl(struct file *filp, u_int cmd, u_long arg)

Type:long

Parameter:

TypeParameterName
struct file *filp
u_intcmd
u_longarg
1523  as = needed for tty driver, and maybe others
1524  If check_apm_user(as, "ioctl") Then Return -EIO
1526  If Not suser || Not writer Then Return -EPERM
1529  Case cmd == APM_IOC_STANDBY
1530  mutex_lock( & apm_mutex)
1531  If standbys_read > 0 Then
1532  standbys_read--
1533  standbys_pending--
1534  standbys_pending--
1535  Else queue_event(APM_USER_STANDBY, as)
1537  If standbys_pending <= 0 Then standby()
1539  mutex_unlock( & apm_mutex)
1540  Break
1541  Case cmd == APM_IOC_SUSPEND
1542  mutex_lock( & apm_mutex)
1543  If suspends_read > 0 Then
1544  suspends_read--
1545  suspends_pending--
1546  suspends_pending--
1547  Else queue_event(APM_USER_SUSPEND, as)
1549  If suspends_pending <= 0 Then
1550  ret = suspend(1)
1551  mutex_unlock( & apm_mutex)
1552  Else
1553  suspend_wait = 1
1554  mutex_unlock( & apm_mutex)
1557  ret = suspend_result
1559  Return ret
1560  Default
1561  Return -ENOTTY
1563  Return 0