- Perl Basics
- Perl - Home
- Perl - Introduction
- Perl - Environment
- Perl - Syntax Overview
- Perl - Data Types
- Perl - Variables
- Perl - Scalars
- Perl - Arrays
- Perl - Hashes
- Perl - IF...ELSE
- Perl - Loops
- Perl - Operators
- Perl - Date & Time
- Perl - Subroutines
- Perl - References
- Perl - Formats
- Perl - File I/O
- Perl - Directories
- Perl - Error Handling
- Perl - Special Variables
- Perl - Coding Standard
- Perl - Regular Expressions
- Perl - Sending Email
- Perl Advanced
- Perl - Socket Programming
- Perl - Object Oriented
- Perl - Database Access
- Perl - CGI Programming
- Perl - Packages & Modules
- Perl - Process Management
- Perl - Embedded Documentation
- Perl - Functions References
- Perl Useful Resources
- Perl - Questions and Answers
- Perl - Quick Guide
- Perl - Useful Resources
- Perl - Discussion
Perl syscall Function
Description
This function calls the system call specified as the first element of the list, passing the remaining elements as arguments to the system call. If a given argument is numeric, the argument is passed as an int. If not, the pointer to the string value is passed.
Syntax
Following is the simple syntax for this function −
syscall EXPR, LIST
Return Value
This function returns -1 on failure of system call and values returned by system function on success.
Example
Following is the example code showing its basic usage −
#!/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 );
When above code is executed, it produces the following result −
PID of this process is 23705
perl_function_references.htm
Advertisements