我正在阅读了解Linux内核,其中我读到了全局描述符表和本地描述符表.
在哪个源文件(linux内核)中定义了GDT和LDT的数据结构?
int *getAr()
{
int *a;
int i;
a=(int*)malloc(sizeof(int)*10);
for(i=0;i<10;i++)
a[i]=i;
return(a);
}
int main()
{
int *a;
int i;
a=getAr();
for(i=0;i<10;i++)
printf("%d\t",a[i]);
printf("\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输出是:
0 1 2 3 4 5 6 7 8 9
我正在编写一个Perl脚本,它分叉32000个进程,每个进程执行24小时的一系列操作.但我无法分叉那么多进程.任何解决方法?请注意,代码适用于较少数量的进程.这是我得到的错误:
pty_allocate(nonfatal): posix_openpt(): No space left on device at /usr/local/lib64/perl5/IO/Pty.pm line 24.
pty_allocate(nonfatal): getpt(): No such file or directory at /usr/local/lib64/perl5/IO/Pty.pm line 24.
pty_allocate(nonfatal): getpt(): No such file or directory at /usr/local/lib64/perl5/IO/Pty.pm line 24.
pty_allocate(nonfatal): openpty(): No such file or directory at /usr/local/lib64/perl5/IO/Pty.pm line 24.
pty_allocate(nonfatal): open(/dev/ptmx): No space left on device at /usr/local/lib64/perl5/IO/Pty.pm line 24.
Run Code Online (Sandbox Code Playgroud)