📄 1425-1431.html
字号:
<P>Returns a pointer to the entry in the file table.
</P>
<P><B>
AUTHOR
</B></P>
<P>Linus Torvalds
</P>
<P><B>
SEE ALSO
</B></P>
<!-- CODE SNIP //-->
<PRE>
grow_files(9)
</PRE>
<!-- END CODE SNIP //-->
<P>Linux 0.99.10, 12 July 1993
</P>
<H3><A NAME="ch09_ 9">
grow_files
</A></H3>
<P>grow_files—Adds entries to the file table.
</P>
<P><B>
SYNOPSIS
</B></P>
<!-- CODE SNIP //-->
<PRE>
linux/fs/file table.c
void grow_files(void);
</PRE>
<!-- END CODE SNIP //-->
<P><B>
DESCRIPTION
</B></P>
<P>This function adds entries to the file table. First, it allocates a page of memory. It fills the entire page with entries,
adding each to the file table.
</P>
<P><B>
AUTHOR
</B></P>
<P>Linus Torvalds
</P>
<A NAME="PAGENUM-1429"><P>Page 1429</P></A>
<P>insert_file_free
</P>
<P><B>
SEE ALSO
</B></P>
<!-- CODE SNIP //-->
<PRE>insert_file_free(9), remove_file_free(9),
put_last_free(9)
</PRE>
<!-- END CODE SNIP //-->
<P>Linux 0.99.10, 12 July 1993
</P>
<H3><A NAME="ch09_ 10">
in_group_p
</A></H3>
<P>in_group_p—Searches group IDs for a match.
</P>
<P><B>
SYNOPSIS
</B></P>
<!-- CODE SNIP //-->
<PRE>
linux/kernel/sys.c
int in_group_p(gid_t grp);
</PRE>
<!-- END CODE SNIP //-->
<P><B>
DESCRIPTION
</B></P>
<P>Searches supplementary group IDs and the effective group ID for a match with
grp.
</P>
<P><B>
RETURN VALUE
</B></P>
<P>Returns True (1) if found; otherwise, false (0).
</P>
<P><B>
AUTHOR
</B></P>
<P>Linus Torvalds
</P>
<P><B>
SEE ALSO
</B></P>
<!-- CODE SNIP //-->
<PRE>getgroups(2), getgid(2), getregid(2), setgid(2),
setregid(2), setgroups(2)
</PRE>
<!-- END CODE SNIP //-->
<P>Linux 0.99.10, 7 July 1993
</P>
<H3><A NAME="ch09_ 11">
insert_file_free
</A></H3>
<P>insert_file_free—Adds a file entry into the file table.
</P>
<P><B>
SYNOPSIS
</B></P>
<!-- CODE SNIP //-->
<PRE>
linux/fs/file_table.c
static void insert_file_free(struct file *file);
</PRE>
<!-- END CODE SNIP //-->
<P><B>
DESCRIPTION
</B></P>
<P>This nightmare of pointers adds file into the file table with the root pointer at
file. This is a building block of the file table management.
</P>
<P><B>
AUTHOR
</B></P>
<P>Linus Torvalds
</P>
<P><B>
SEE ALSO
</B></P>
<!-- CODE SNIP //-->
<PRE>file_table_init(9), remove_file_free(9),
put_last_free(9)
</PRE>
<!-- END CODE SNIP //-->
<P>See file_table(9) for details on the file table structure.
</P>
<P>Linux 0.99.10
</P>
<A NAME="PAGENUM-1430"><P>Page 1430</P></A>
<H3><A NAME="ch09_ 12">
kernel_mktime
</A></H3>
<P>kernel_mktime—Convert startup struct
mktime into the number of seconds since 00:00:00 January 1, 1970.
</P>
<P><B>
SYNOPSIS
</B></P>
<!-- CODE SNIP //-->
<PRE>
linux/kernel/mktime.c
long kernel_mktime(struct mktime * time);
</PRE>
<!-- END CODE SNIP //-->
<P><B>
DESCRIPTION
</B></P>
<P>This routine is called from time_init(void),
linux/init/main.c. kernel_mktime() converts struct
mktime (initialized from CMOS) into an encoded long.
</P>
<P><B>
CONVERSION METHOD
</B></P>
<P>First an array, month[12], is created, holding how many seconds have passed to reach a peculiar month for a leap year.
Next, it subtracts 70 from the current year, making 1970 the beginning year. It is math magic after this point; please look
yourself. If you know why it does this, then send e-mail (see
nroff source).
</P>
<P><B>
RETURN VALUE
</B></P>
<P>Returns the encoded time in a long.
</P>
<P><B>
FILES
</B></P>
<P>linux/kernel/mktime.c home of routine
</P>
<P><B>
NOTE
</B></P>
<P>This routine is called only during startup of the kernel.
</P>
<P>Historically, the value (encoded long) counts the number of seconds since the Epoch, which occurred at 00:00:00 January
1, 1970, and is called Coordinated Universal Time (UTC). In older manuals, this event is called Greenwich Mean
Time (GMT).
</P>
<P><B>
WARNINGS
</B></P>
<P>kernel_mktime() doesn't check to see if the year is greater than 1969. Be sure your CMOS is set correctly. It is customary
to set on-board clocks to GMT and let processes who ask for the time to convert it to local time, if necessary.
</P>
<P><B>
RESTRICTIONS
</B></P>
<P>For kernel use only.
</P>
<P><B>
AUTHOR
</B></P>
<P>Linus Torvalds
</P>
<P>Linux 0.99.10, 5 July 1993
</P>
<H4><A NAME="ch09_ 13">
proc_sel
</A></H4>
<P>proc_sel—Select a process by a criterion.
</P>
<P><B>
SYNOPSIS
</B></P>
<!-- CODE SNIP //-->
<PRE>
linux/kernel/sys.c
#include <linux/resource.h>
static int proc_sel(struct task_struct *p, int which, int who);
</PRE>
<!-- END CODE SNIP //-->
<A NAME="PAGENUM-1431"><P>Page 1431</P></A>
<P><B>
DESCRIPTION
</B></P>
<P>Compares a task p to supplied information or the current task in some aspect of priority. If
who is zero, the comparison is task p and the current task. Otherwise,
who and *p are the supplied information for the comparison.
</P>
<P><B>
OPTIONS
</B></P>
<P>Valid values of which:
</P>
<TABLE>
<TR><TD>
PRIO_PROCESS
</TD><TD>
Compares process ID numbers. There is an exception here. If
who is not zero and task p is the current task, then
True is always returned.
</TD></TR><TR><TD>
PRIO_PGRP
</TD><TD>
Compares process group leader numbers.
</TD></TR><TR><TD>
PRIO_USER
</TD><TD>
Compares user ID numbers.
</TD></TR></TABLE>
<P><B>
RETURN VALUE
</B></P>
<P>Returns truth values (0, 1).
</P>
<P><B>
AUTHOR
</B></P>
<P>Linus Torvalds
</P>
<P><B>
SEE ALSO
</B></P>
<!-- CODE SNIP //-->
<PRE>
sys_setpriority(2), sys_getpriority(2)
</PRE>
<!-- END CODE SNIP //-->
<P>Linux 0.99.10, 7 July 1993
</P>
<H3><A NAME="ch09_ 14">
put_file_last
</A></H3>
<P>put_file_last—Moves a file to the "end" of the file table.
</P>
<P><B>
SYNOPSIS
</B></P>
<!-- CODE SNIP //-->
<PRE>
linux/fs/file table.c
static void put_last_free(struct file *file);
</PRE>
<!-- END CODE SNIP //-->
<P><B>
DESCRIPTION
</B></P>
<P>This function will remove file from the file table and insert it again at the end. You can access by
</P>
<P>first_file->prev
</P>
<P><B>
AUTHOR
</B></P>
<P>Linus Torvalds
</P>
<P><B>
SEE ALSO
</B></P>
<!-- CODE SNIP //-->
<PRE>
insert_file_free(9), remove_file_free(9)
</PRE>
<!-- END CODE SNIP //-->
<P>Linux 0.99.10, 11 July 1993
</P>
<H3><A NAME="ch09_ 15">
remove_file_free
</A></H3>
<P>remove_file_free—Remove a file table entry from the linked list.
</P>
<P><B>
SYNOPSIS
</B></P>
<!-- CODE SNIP //-->
<PRE>
linux/fs/file table.c
static void remove_file_free(struct file *file);
</PRE>
<!-- END CODE SNIP //-->
<P><CENTER>
<a href="1423-1424.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1432-1432.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -