- Perl 基础
- Perl - 首页
- Perl - 介绍
- Perl - 环境
- Perl - 语法概览
- Perl - 数据类型
- Perl - 变量
- Perl - 标量
- Perl - 数组
- Perl - 哈希
- Perl - IF...ELSE
- Perl - 循环
- Perl - 运算符
- Perl - 日期和时间
- Perl - 子例程
- Perl - 引用
- Perl - 格式
- Perl - 文件 I/O
- Perl - 目录
- Perl - 错误处理
- Perl - 特殊变量
- Perl - 编码标准
- Perl - 正则表达式
- Perl - 发送电子邮件
- Perl 高级
- Perl - Socket 编程
- Perl - 面向对象
- Perl - 数据库访问
- Perl - CGI 编程
- Perl - 包和模块
- Perl - 进程管理
- Perl - 嵌入式文档
- Perl - 函数引用
- Perl 有用的资源
- Perl - 问题和答案
- Perl - 快速指南
- Perl - 有用的资源
- Perl - 讨论
Perl syscall 函数
描述
此函数调用指定为列表第一个元素的系统调用,并将剩余元素作为参数传递给系统调用。如果给定参数是数字,则该参数将作为 int 传递。如果不是,则传递对字符串值的指针。
语法
以下是此函数的简单语法 -
syscall EXPR, LIST
返回值
此函数在系统调用失败时返回 -1,并在成功时返回系统函数返回的值。
示例
以下是显示基本用法的示例代码 -
#!/usr/bin/perl -w
require("syscall.ph");
$pid = syscall(&SYS_getpid);
print "PID of this process is $pid\n";
# To create directory use the following
$string = "newdir";
syscall( &SYS_mkdir, $string );
执行上述代码时,它将产生以下结果 -
PID of this process is 23705
perl_function_references.htm
广告