CINXE.COM
POSIX - Perl interface to IEEE Std 1003.1 - Perldoc Browser
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>POSIX - Perl interface to IEEE Std 1003.1 - Perldoc Browser</title> <link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser"> <link rel="canonical" href="https://perldoc.perl.org/POSIX"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" /> <style> body { background: #f4f4f5; color: #020202; } .navbar-dark { background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%); background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%); background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0); background-repeat: repeat-x; } .navbar-dark .navbar-nav .nav-link, .navbar-dark .navbar-nav .nav-link:focus { color: #fff } .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 } #wrapperlicious { margin: 0 auto; font: 0.9em 'Helvetica Neue', Helvetica, sans-serif; font-weight: normal; line-height: 1.5em; margin: 0; padding: 0; } #wrapperlicious h1 { font-size: 1.5em } #wrapperlicious h2 { font-size: 1.3em } #wrapperlicious h3 { font-size: 1.1em } #wrapperlicious h4 { font-size: 0.9em } #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3, #wrapperlicious h4, #wrapperlicious dt { color: #020202; margin-top: 1em; margin-bottom: 1em; position: relative; font-weight: bold; } #wrapperlicious a { color: inherit; text-decoration: underline } #wrapperlicious #toc { text-decoration: none } #wrapperlicious a:hover { color: #2a2a2a } #wrapperlicious a img { border: 0 } #wrapperlicious :not(pre) > code { color: inherit; background-color: rgba(0, 0, 0, 0.04); border-radius: 3px; font: 0.9em Consolas, Menlo, Monaco, monospace; padding: 0.3em; } #wrapperlicious dd { margin: 0; margin-left: 2em; } #wrapperlicious dt { color: #2a2a2a; font-weight: bold; margin-left: 0.9em; } #wrapperlicious p { margin-bottom: 1em; margin-top: 1em; } #wrapperlicious li > p { margin-bottom: 0; margin-top: 0; } #wrapperlicious pre { border: 1px solid #c1c1c1; border-radius: 3px; font: 100% Consolas, Menlo, Monaco, monospace; margin-bottom: 1em; margin-top: 1em; } #wrapperlicious pre > code { display: block; background-color: #f6f6f6; font: 0.9em Consolas, Menlo, Monaco, monospace; line-height: 1.5em; text-align: left; white-space: pre; padding: 1em; } #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul { margin-bottom: 1em; margin-top: 1em; } #wrapperlicious ul { list-style-type: square; } #wrapperlicious ul ul { margin-bottom: 0px; margin-top: 0px; } #footer { font-size: 0.8em; padding-top: 0.5em; text-align: center; } #more { display: inline; font-size: 0.8em; } #perldocdiv { background-color: #fff; border: 1px solid #c1c1c1; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; margin-left: auto; margin-right: auto; padding: 3em; padding-top: 1em; max-width: 960px; } #moduleversion { float: right } #wrapperlicious .leading-notice { font-style: italic; padding-left: 1em; margin-top: 1em; margin-bottom: 1em; } #wrapperlicious .permalink { display: none; left: -0.75em; position: absolute; padding-right: 0.25em; text-decoration: none; } #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink, #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink, #wrapperlicious dt:hover .permalink { display: block; } </style> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-KVNWBNT5FB'); gtag('config', 'UA-50555-3'); </script> </head> <body> <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand" href="/"><img src="/images/perl_camel_30.png" width="30" height="30" class="d-inline-block align-top" alt="Perl Camel Logo"> Perldoc Browser</a> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav mr-auto"> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.6.1</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-stable"> <a class="dropdown-item" href="/POSIX">Latest</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.1/POSIX">5.40.1</a> <a class="dropdown-item" href="/5.40.0/POSIX">5.40.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.38.3/POSIX">5.38.3</a> <a class="dropdown-item" href="/5.38.2/POSIX">5.38.2</a> <a class="dropdown-item" href="/5.38.1/POSIX">5.38.1</a> <a class="dropdown-item" href="/5.38.0/POSIX">5.38.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.36.3/POSIX">5.36.3</a> <a class="dropdown-item" href="/5.36.2/POSIX">5.36.2</a> <a class="dropdown-item" href="/5.36.1/POSIX">5.36.1</a> <a class="dropdown-item" href="/5.36.0/POSIX">5.36.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.34.3/POSIX">5.34.3</a> <a class="dropdown-item" href="/5.34.2/POSIX">5.34.2</a> <a class="dropdown-item" href="/5.34.1/POSIX">5.34.1</a> <a class="dropdown-item" href="/5.34.0/POSIX">5.34.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.32.1/POSIX">5.32.1</a> <a class="dropdown-item" href="/5.32.0/POSIX">5.32.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.30.3/POSIX">5.30.3</a> <a class="dropdown-item" href="/5.30.2/POSIX">5.30.2</a> <a class="dropdown-item" href="/5.30.1/POSIX">5.30.1</a> <a class="dropdown-item" href="/5.30.0/POSIX">5.30.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.28.3/POSIX">5.28.3</a> <a class="dropdown-item" href="/5.28.2/POSIX">5.28.2</a> <a class="dropdown-item" href="/5.28.1/POSIX">5.28.1</a> <a class="dropdown-item" href="/5.28.0/POSIX">5.28.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.26.3/POSIX">5.26.3</a> <a class="dropdown-item" href="/5.26.2/POSIX">5.26.2</a> <a class="dropdown-item" href="/5.26.1/POSIX">5.26.1</a> <a class="dropdown-item" href="/5.26.0/POSIX">5.26.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.24.4/POSIX">5.24.4</a> <a class="dropdown-item" href="/5.24.3/POSIX">5.24.3</a> <a class="dropdown-item" href="/5.24.2/POSIX">5.24.2</a> <a class="dropdown-item" href="/5.24.1/POSIX">5.24.1</a> <a class="dropdown-item" href="/5.24.0/POSIX">5.24.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.22.4/POSIX">5.22.4</a> <a class="dropdown-item" href="/5.22.3/POSIX">5.22.3</a> <a class="dropdown-item" href="/5.22.2/POSIX">5.22.2</a> <a class="dropdown-item" href="/5.22.1/POSIX">5.22.1</a> <a class="dropdown-item" href="/5.22.0/POSIX">5.22.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.20.3/POSIX">5.20.3</a> <a class="dropdown-item" href="/5.20.2/POSIX">5.20.2</a> <a class="dropdown-item" href="/5.20.1/POSIX">5.20.1</a> <a class="dropdown-item" href="/5.20.0/POSIX">5.20.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.18.4/POSIX">5.18.4</a> <a class="dropdown-item" href="/5.18.3/POSIX">5.18.3</a> <a class="dropdown-item" href="/5.18.2/POSIX">5.18.2</a> <a class="dropdown-item" href="/5.18.1/POSIX">5.18.1</a> <a class="dropdown-item" href="/5.18.0/POSIX">5.18.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.16.3/POSIX">5.16.3</a> <a class="dropdown-item" href="/5.16.2/POSIX">5.16.2</a> <a class="dropdown-item" href="/5.16.1/POSIX">5.16.1</a> <a class="dropdown-item" href="/5.16.0/POSIX">5.16.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.14.4/POSIX">5.14.4</a> <a class="dropdown-item" href="/5.14.3/POSIX">5.14.3</a> <a class="dropdown-item" href="/5.14.2/POSIX">5.14.2</a> <a class="dropdown-item" href="/5.14.1/POSIX">5.14.1</a> <a class="dropdown-item" href="/5.14.0/POSIX">5.14.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.12.5/POSIX">5.12.5</a> <a class="dropdown-item" href="/5.12.4/POSIX">5.12.4</a> <a class="dropdown-item" href="/5.12.3/POSIX">5.12.3</a> <a class="dropdown-item" href="/5.12.2/POSIX">5.12.2</a> <a class="dropdown-item" href="/5.12.1/POSIX">5.12.1</a> <a class="dropdown-item" href="/5.12.0/POSIX">5.12.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.10.1/POSIX">5.10.1</a> <a class="dropdown-item" href="/5.10.0/POSIX">5.10.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.8.9/POSIX">5.8.9</a> <a class="dropdown-item" href="/5.8.8/POSIX">5.8.8</a> <a class="dropdown-item" href="/5.8.7/POSIX">5.8.7</a> <a class="dropdown-item" href="/5.8.6/POSIX">5.8.6</a> <a class="dropdown-item" href="/5.8.5/POSIX">5.8.5</a> <a class="dropdown-item" href="/5.8.4/POSIX">5.8.4</a> <a class="dropdown-item" href="/5.8.3/POSIX">5.8.3</a> <a class="dropdown-item" href="/5.8.2/POSIX">5.8.2</a> <a class="dropdown-item" href="/5.8.1/POSIX">5.8.1</a> <a class="dropdown-item" href="/5.8.0/POSIX">5.8.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.2/POSIX">5.6.2</a> <a class="dropdown-item active" href="/5.6.1/POSIX">5.6.1</a> <a class="dropdown-item" href="/5.6.0/POSIX">5.6.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.005_04/POSIX">5.005_04</a> <a class="dropdown-item" href="/5.005_03/POSIX">5.005_03</a> <a class="dropdown-item" href="/5.005_02/POSIX">5.005_02</a> <a class="dropdown-item" href="/5.005_01/POSIX">5.005_01</a> <a class="dropdown-item" href="/5.005/POSIX">5.005</a> </div> </li> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-dev"> <a class="dropdown-item" href="/blead/POSIX">blead</a> <a class="dropdown-item" href="/5.41.9/POSIX">5.41.9</a> <a class="dropdown-item" href="/5.41.8/POSIX">5.41.8</a> <a class="dropdown-item" href="/5.41.7/POSIX">5.41.7</a> <a class="dropdown-item" href="/5.41.6/POSIX">5.41.6</a> <a class="dropdown-item" href="/5.41.5/POSIX">5.41.5</a> <a class="dropdown-item" href="/5.41.4/POSIX">5.41.4</a> <a class="dropdown-item" href="/5.41.3/POSIX">5.41.3</a> <a class="dropdown-item" href="/5.41.2/POSIX">5.41.2</a> <a class="dropdown-item" href="/5.41.1/POSIX">5.41.1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.1-RC1/POSIX">5.40.1-RC1</a> <a class="dropdown-item" href="/5.40.0-RC2/POSIX">5.40.0-RC2</a> <a class="dropdown-item" href="/5.40.0-RC1/POSIX">5.40.0-RC1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.39.10/POSIX">5.39.10</a> <a class="dropdown-item" href="/5.39.9/POSIX">5.39.9</a> <a class="dropdown-item" href="/5.39.8/POSIX">5.39.8</a> <a class="dropdown-item" href="/5.39.7/POSIX">5.39.7</a> <a class="dropdown-item" href="/5.39.6/POSIX">5.39.6</a> <a class="dropdown-item" href="/5.39.5/POSIX">5.39.5</a> <a class="dropdown-item" href="/5.39.4/POSIX">5.39.4</a> <a class="dropdown-item" href="/5.39.3/POSIX">5.39.3</a> <a class="dropdown-item" href="/5.39.2/POSIX">5.39.2</a> <a class="dropdown-item" href="/5.39.1/POSIX">5.39.1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.38.3-RC1/POSIX">5.38.3-RC1</a> </div> </li> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-nav"> <a class="dropdown-item" href="/5.6.1/perl">Perl</a> <a class="dropdown-item" href="/5.6.1/perlintro">Intro</a> <a class="dropdown-item" href="/5.6.1/perl#Tutorials">Tutorials</a> <a class="dropdown-item" href="/5.6.1/perlfaq">FAQs</a> <a class="dropdown-item" href="/5.6.1/perl#Reference-Manual">Reference</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.1/perlop">Operators</a> <a class="dropdown-item" href="/5.6.1/functions">Functions</a> <a class="dropdown-item" href="/5.6.1/variables">Variables</a> <a class="dropdown-item" href="/5.6.1/modules">Modules</a> <a class="dropdown-item" href="/5.6.1/perlutil">Utilities</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.1/perldelta">Release Notes</a> <a class="dropdown-item" href="/5.6.1/perlcommunity">Community</a> <a class="dropdown-item" href="/5.6.1/perlhist">History</a> </div> </li> </ul> <ul class="navbar-nav"> <script> function set_expand (expand) { var perldocdiv = document.getElementById('perldocdiv'); var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width'); var expanded = (width == '' || width == 'none') ? true : false; if (expand === null) { expand = !expanded; } if ((expand && !expanded) || (!expand && expanded)) { perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px'); var button_classlist = document.getElementById('content-expand-button').classList; if (expand) { button_classlist.add('btn-light'); button_classlist.remove('btn-outline-light'); } else { button_classlist.add('btn-outline-light'); button_classlist.remove('btn-light'); } } return expand; } function toggle_expand () { var expand = set_expand(null); document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC'; } function read_expand () { return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function () { if (read_expand()) { set_expand(true); } }); } else if (read_expand()) { set_expand(true); } </script> <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-4" onclick="toggle_expand()">Expand</button> </ul> <form class="form-inline" method="get" action="/5.6.1/search"> <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search" value=""> </form> </div> </nav> <div id="wrapperlicious" class="container-fluid"> <div id="perldocdiv"> <div id="links"> <a href="/5.6.1/POSIX">POSIX</a> <div id="more"> (<a href="/5.6.1/POSIX.txt">source</a>, <a href="https://metacpan.org/pod/POSIX">CPAN</a>) </div> <div id="moduleversion">version 1.03</div> </div> <div class="leading-notice"> You are viewing the version of this documentation from Perl 5.6.1. <a href="/POSIX">View the latest version</a> </div> <h1><a id="toc">CONTENTS</a></h1> <ul> <li> <a class="text-decoration-none" href="#NAME">NAME</a> </li> <li> <a class="text-decoration-none" href="#SYNOPSIS">SYNOPSIS</a> </li> <li> <a class="text-decoration-none" href="#DESCRIPTION">DESCRIPTION</a> </li> <li> <a class="text-decoration-none" href="#NOTE">NOTE</a> </li> <li> <a class="text-decoration-none" href="#CAVEATS">CAVEATS</a> </li> <li> <a class="text-decoration-none" href="#FUNCTIONS">FUNCTIONS</a> </li> <li> <a class="text-decoration-none" href="#CLASSES">CLASSES</a> <ul> <li> <a class="text-decoration-none" href="#POSIX::SigAction">POSIX::SigAction</a> </li> <li> <a class="text-decoration-none" href="#POSIX::SigSet">POSIX::SigSet</a> </li> <li> <a class="text-decoration-none" href="#POSIX::Termios">POSIX::Termios</a> </li> </ul> </li> <li> <a class="text-decoration-none" href="#PATHNAME-CONSTANTS">PATHNAME CONSTANTS</a> </li> <li> <a class="text-decoration-none" href="#POSIX-CONSTANTS">POSIX CONSTANTS</a> </li> <li> <a class="text-decoration-none" href="#SYSTEM-CONFIGURATION">SYSTEM CONFIGURATION</a> </li> <li> <a class="text-decoration-none" href="#ERRNO">ERRNO</a> </li> <li> <a class="text-decoration-none" href="#FCNTL">FCNTL</a> </li> <li> <a class="text-decoration-none" href="#FLOAT">FLOAT</a> </li> <li> <a class="text-decoration-none" href="#LIMITS">LIMITS</a> </li> <li> <a class="text-decoration-none" href="#LOCALE">LOCALE</a> </li> <li> <a class="text-decoration-none" href="#MATH">MATH</a> </li> <li> <a class="text-decoration-none" href="#SIGNAL">SIGNAL</a> </li> <li> <a class="text-decoration-none" href="#STAT">STAT</a> </li> <li> <a class="text-decoration-none" href="#STDLIB">STDLIB</a> </li> <li> <a class="text-decoration-none" href="#STDIO">STDIO</a> </li> <li> <a class="text-decoration-none" href="#TIME">TIME</a> </li> <li> <a class="text-decoration-none" href="#UNISTD">UNISTD</a> </li> <li> <a class="text-decoration-none" href="#WAIT">WAIT</a> </li> </ul> <h1 id="NAME"><a class="permalink" href="#NAME">#</a>NAME</h1> <p>POSIX - Perl interface to IEEE Std 1003.1</p> <h1 id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">#</a>SYNOPSIS</h1> <pre><code> use POSIX; use POSIX qw(setsid); use POSIX qw(:errno_h :fcntl_h); printf "EINTR is %d\n", EINTR; $sess_id = POSIX::setsid(); $fd = POSIX::open($path, O_CREAT|O_EXCL|O_WRONLY, 0644); # note: that's a filedescriptor, *NOT* a filehandle</code></pre> <h1 id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">#</a>DESCRIPTION</h1> <p>The POSIX module permits you to access all (or nearly all) the standard POSIX 1003.1 identifiers. Many of these identifiers have been given Perl-ish interfaces. Things which are <code>#defines</code> in C, like EINTR or O_NDELAY, are automatically exported into your namespace. All functions are only exported if you ask for them explicitly. Most likely people will prefer to use the fully-qualified function names.</p> <p>This document gives a condensed list of the features available in the POSIX module. Consult your operating system's manpages for general information on most features. Consult <a href="/5.6.1/perlfunc">perlfunc</a> for functions which are noted as being identical to Perl's builtin functions.</p> <p>The first section describes POSIX functions from the 1003.1 specification. The second section describes some classes for signal objects, TTY objects, and other miscellaneous objects. The remaining sections list various constants and macros in an organization which roughly follows IEEE Std 1003.1b-1993.</p> <h1 id="NOTE"><a class="permalink" href="#NOTE">#</a>NOTE</h1> <p>The POSIX module is probably the most complex Perl module supplied with the standard distribution. It incorporates autoloading, namespace games, and dynamic loading of code that's in Perl, C, or both. It's a great source of wisdom.</p> <h1 id="CAVEATS"><a class="permalink" href="#CAVEATS">#</a>CAVEATS</h1> <p>A few functions are not implemented because they are C specific. If you attempt to call these, they will print a message telling you that they aren't implemented, and suggest using the Perl equivalent should one exist. For example, trying to access the setjmp() call will elicit the message "setjmp() is C-specific: use eval {} instead".</p> <p>Furthermore, some evil vendors will claim 1003.1 compliance, but in fact are not so: they will not pass the PCTS (POSIX Compliance Test Suites). For example, one vendor may not define EDEADLK, or the semantics of the errno values set by open(2) might not be quite right. Perl does not attempt to verify POSIX compliance. That means you can currently successfully say "use POSIX", and then later in your program you find that your vendor has been lax and there's no usable ICANON macro after all. This could be construed to be a bug.</p> <h1 id="FUNCTIONS"><a class="permalink" href="#FUNCTIONS">#</a>FUNCTIONS</h1> <dl> <dt id="_exit"><a class="permalink" href="#_exit">#</a><a id="exit1"></a>_exit</dt> <dd> <p>This is identical to the C function <code>_exit()</code>. It exits the program immediately which means among other things buffered I/O is <b>not</b> flushed.</p> </dd> <dt id="abort"><a class="permalink" href="#abort">#</a>abort</dt> <dd> <p>This is identical to the C function <code>abort()</code>. It terminates the process with a <code>SIGABRT</code> signal unless caught by a signal handler or if the handler does not return normally (it e.g. does a <code>longjmp</code>).</p> </dd> <dt id="abs"><a class="permalink" href="#abs">#</a>abs</dt> <dd> <p>This is identical to Perl's builtin <code>abs()</code> function, returning the absolute value of its numerical argument.</p> </dd> <dt id="access"><a class="permalink" href="#access">#</a>access</dt> <dd> <p>Determines the accessibility of a file.</p> <pre><code>if( POSIX::access( "/", &POSIX::R_OK ) ){ print "have read permission\n"; }</code></pre> <p>Returns <code>undef</code> on failure. Note: do not use <code>access()</code> for security purposes. Between the <code>access()</code> call and the operation you are preparing for the permissions might change: a classic <i>race condition</i>.</p> </dd> <dt id="acos"><a class="permalink" href="#acos">#</a>acos</dt> <dd> <p>This is identical to the C function <code>acos()</code>, returning the arcus cosine of its numerical argument. See also <a href="/5.6.1/Math::Trig">Math::Trig</a>.</p> </dd> <dt id="alarm"><a class="permalink" href="#alarm">#</a>alarm</dt> <dd> <p>This is identical to Perl's builtin <code>alarm()</code> function, either for arming or disarming the <code>SIGARLM</code> timer.</p> </dd> <dt id="asctime"><a class="permalink" href="#asctime">#</a>asctime</dt> <dd> <p>This is identical to the C function <code>asctime()</code>. It returns a string of the form</p> <pre><code class="plaintext">"Fri Jun 2 18:22:13 2000\n\0"</code></pre> <p>and it is called thusly</p> <pre><code>$asctime = asctime($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);</code></pre> <p>The <code>$mon</code> is zero-based: January equals <code>0</code>. The <code>$year</code> is 1900-based: 2001 equals <code>101</code>. The <code>$wday</code>, <code>$yday</code>, and <code>$isdst</code> default to zero (and the first two are usually ignored anyway).</p> </dd> <dt id="asin"><a class="permalink" href="#asin">#</a>asin</dt> <dd> <p>This is identical to the C function <code>asin()</code>, returning the arcus sine of its numerical argument. See also <a href="/5.6.1/Math::Trig">Math::Trig</a>.</p> </dd> <dt id="assert"><a class="permalink" href="#assert">#</a>assert</dt> <dd> <p>Unimplemented, but you can use <a href="/5.6.1/perlfunc#die">"die" in perlfunc</a> and the <a href="/5.6.1/Carp">Carp</a> module to achieve similar things.</p> </dd> <dt id="atan"><a class="permalink" href="#atan">#</a>atan</dt> <dd> <p>This is identical to the C function <code>atan()</code>, returning the arcus tangent of its numerical argument. See also <a href="/5.6.1/Math::Trig">Math::Trig</a>.</p> </dd> <dt id="atan2"><a class="permalink" href="#atan2">#</a>atan2</dt> <dd> <p>This is identical to Perl's builtin <code>atan2()</code> function, returning the arcus tangent defined by its two numerical arguments, the <i>y</i> coordinate and the <i>x</i> coordinate. See also <a href="/5.6.1/Math::Trig">Math::Trig</a>.</p> </dd> <dt id="atexit"><a class="permalink" href="#atexit">#</a>atexit</dt> <dd> <p>atexit() is C-specific: use <code>END {}</code> instead, see <a href="/5.6.1/perlsub">perlsub</a>.</p> </dd> <dt id="atof"><a class="permalink" href="#atof">#</a>atof</dt> <dd> <p>atof() is C-specific. Perl converts strings to numbers transparently. If you need to force a scalar to a number, add a zero to it.</p> </dd> <dt id="atoi"><a class="permalink" href="#atoi">#</a>atoi</dt> <dd> <p>atoi() is C-specific. Perl converts strings to numbers transparently. If you need to force a scalar to a number, add a zero to it. If you need to have just the integer part, see <a href="/5.6.1/perlfunc#int">"int" in perlfunc</a>.</p> </dd> <dt id="atol"><a class="permalink" href="#atol">#</a>atol</dt> <dd> <p>atol() is C-specific. Perl converts strings to numbers transparently. If you need to force a scalar to a number, add a zero to it. If you need to have just the integer part, see <a href="/5.6.1/perlfunc#int">"int" in perlfunc</a>.</p> </dd> <dt id="bsearch"><a class="permalink" href="#bsearch">#</a>bsearch</dt> <dd> <p>bsearch() not supplied. For doing binary search on wordlists, see <a href="/5.6.1/Search::Dict">Search::Dict</a>.</p> </dd> <dt id="calloc"><a class="permalink" href="#calloc">#</a>calloc</dt> <dd> <p>calloc() is C-specific. Perl does memory management transparently.</p> </dd> <dt id="ceil"><a class="permalink" href="#ceil">#</a>ceil</dt> <dd> <p>This is identical to the C function <code>ceil()</code>, returning the smallest integer value greater than or equal to the given numerical argument.</p> </dd> <dt id="chdir"><a class="permalink" href="#chdir">#</a>chdir</dt> <dd> <p>This is identical to Perl's builtin <code>chdir()</code> function, allowing one to change the working (default) directory, see <a href="/5.6.1/perlfunc#chdir">"chdir" in perlfunc</a>.</p> </dd> <dt id="chmod"><a class="permalink" href="#chmod">#</a>chmod</dt> <dd> <p>This is identical to Perl's builtin <code>chmod()</code> function, allowing one to change file and directory permissions, see <a href="/5.6.1/perlfunc#chmod">"chmod" in perlfunc</a>.</p> </dd> <dt id="chown"><a class="permalink" href="#chown">#</a>chown</dt> <dd> <p>This is identical to Perl's builtin <code>chown()</code> function, allowing one to change file and directory owners and groups, see <a href="/5.6.1/perlfunc#chown">"chown" in perlfunc</a>.</p> </dd> <dt id="clearerr"><a class="permalink" href="#clearerr">#</a>clearerr</dt> <dd> <p>Use the method <a href="/5.6.1/IO::Handle::clearerr()">IO::Handle::clearerr()</a> instead, to reset the error state (if any) and EOF state (if any) of the given stream.</p> </dd> <dt id="clock"><a class="permalink" href="#clock">#</a>clock</dt> <dd> <p>This is identical to the C function <code>clock()</code>, returning the amount of spent processor time in microseconds.</p> </dd> <dt id="close"><a class="permalink" href="#close">#</a>close</dt> <dd> <p>Close the file. This uses file descriptors such as those obtained by calling <code>POSIX::open</code>.</p> <pre><code>$fd = POSIX::open( "foo", &POSIX::O_RDONLY ); POSIX::close( $fd );</code></pre> <p>Returns <code>undef</code> on failure.</p> <p>See also <a href="/5.6.1/perlfunc#close">"close" in perlfunc</a>.</p> </dd> <dt id="closedir"><a class="permalink" href="#closedir">#</a>closedir</dt> <dd> <p>This is identical to Perl's builtin <code>closedir()</code> function for closing a directory handle, see <a href="/5.6.1/perlfunc#closedir">"closedir" in perlfunc</a>.</p> </dd> <dt id="cos"><a class="permalink" href="#cos">#</a>cos</dt> <dd> <p>This is identical to Perl's builtin <code>cos()</code> function, for returning the cosine of its numerical argument, see <a href="/5.6.1/perlfunc#cos">"cos" in perlfunc</a>. See also <a href="/5.6.1/Math::Trig">Math::Trig</a>.</p> </dd> <dt id="cosh"><a class="permalink" href="#cosh">#</a>cosh</dt> <dd> <p>This is identical to the C function <code>cosh()</code>, for returning the hyperbolic cosine of its numeric argument. See also <a href="/5.6.1/Math::Trig">Math::Trig</a>.</p> </dd> <dt id="creat"><a class="permalink" href="#creat">#</a>creat</dt> <dd> <p>Create a new file. This returns a file descriptor like the ones returned by <code>POSIX::open</code>. Use <code>POSIX::close</code> to close the file.</p> <pre><code>$fd = POSIX::creat( "foo", 0611 ); POSIX::close( $fd );</code></pre> <p>See also <a href="/5.6.1/perlfunc#sysopen">"sysopen" in perlfunc</a> and its <code>O_CREAT</code> flag.</p> </dd> <dt id="ctermid"><a class="permalink" href="#ctermid">#</a>ctermid</dt> <dd> <p>Generates the path name for the controlling terminal.</p> <pre><code>$path = POSIX::ctermid();</code></pre> </dd> <dt id="ctime"><a class="permalink" href="#ctime">#</a>ctime</dt> <dd> <p>This is identical to the C function <code>ctime()</code> and equivalent to <code>asctime(localtime(...))</code>, see <a href="#asctime">"asctime"</a> and <a href="#localtime">"localtime"</a>.</p> </dd> <dt id="cuserid"><a class="permalink" href="#cuserid">#</a>cuserid</dt> <dd> <p>Get the login name of the owner of the current process.</p> <pre><code>$name = POSIX::cuserid();</code></pre> </dd> <dt id="difftime"><a class="permalink" href="#difftime">#</a>difftime</dt> <dd> <p>This is identical to the C function <code>difftime()</code>, for returning the time difference (in seconds) between two times (as returned by <code>time()</code>), see <a href="#time">"time"</a>.</p> </dd> <dt id="div"><a class="permalink" href="#div">#</a>div</dt> <dd> <p>div() is C-specific, use <a href="/5.6.1/perlfunc#int">"int" in perlfunc</a> on the usual <code>/</code> division and the modulus <code>%</code>.</p> </dd> <dt id="dup"><a class="permalink" href="#dup">#</a>dup</dt> <dd> <p>This is similar to the C function <code>dup()</code>, for duplicating a file descriptor.</p> <p>This uses file descriptors such as those obtained by calling <code>POSIX::open</code>.</p> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="dup2"><a class="permalink" href="#dup2">#</a>dup2</dt> <dd> <p>This is similar to the C function <code>dup2()</code>, for duplicating a file descriptor to an another known file descriptor.</p> <p>This uses file descriptors such as those obtained by calling <code>POSIX::open</code>.</p> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="errno"><a class="permalink" href="#errno">#</a>errno</dt> <dd> <p>Returns the value of errno.</p> <pre><code>$errno = POSIX::errno();</code></pre> <p>This identical to the numerical values of the <code>$!</code>, see <a href="/5.6.1/perlvar#%24ERRNO">"$ERRNO" in perlvar</a>.</p> </dd> <dt id="execl"><a class="permalink" href="#execl">#</a>execl</dt> <dd> <p>execl() is C-specific, see <a href="/5.6.1/perlfunc#exec">"exec" in perlfunc</a>.</p> </dd> <dt id="execle"><a class="permalink" href="#execle">#</a>execle</dt> <dd> <p>execle() is C-specific, see <a href="/5.6.1/perlfunc#exec">"exec" in perlfunc</a>.</p> </dd> <dt id="execlp"><a class="permalink" href="#execlp">#</a>execlp</dt> <dd> <p>execlp() is C-specific, see <a href="/5.6.1/perlfunc#exec">"exec" in perlfunc</a>.</p> </dd> <dt id="execv"><a class="permalink" href="#execv">#</a>execv</dt> <dd> <p>execv() is C-specific, see <a href="/5.6.1/perlfunc#exec">"exec" in perlfunc</a>.</p> </dd> <dt id="execve"><a class="permalink" href="#execve">#</a>execve</dt> <dd> <p>execve() is C-specific, see <a href="/5.6.1/perlfunc#exec">"exec" in perlfunc</a>.</p> </dd> <dt id="execvp"><a class="permalink" href="#execvp">#</a>execvp</dt> <dd> <p>execvp() is C-specific, see <a href="/5.6.1/perlfunc#exec">"exec" in perlfunc</a>.</p> </dd> <dt id="exit"><a class="permalink" href="#exit">#</a>exit</dt> <dd> <p>This is identical to Perl's builtin <code>exit()</code> function for exiting the program, see <a href="/5.6.1/perlfunc#exit">"exit" in perlfunc</a>.</p> </dd> <dt id="exp"><a class="permalink" href="#exp">#</a>exp</dt> <dd> <p>This is identical to Perl's builtin <code>exp()</code> function for returning the exponent (<i>e</i>-based) of the numerical argument, see <a href="/5.6.1/perlfunc#exp">"exp" in perlfunc</a>.</p> </dd> <dt id="fabs"><a class="permalink" href="#fabs">#</a>fabs</dt> <dd> <p>This is identical to Perl's builtin <code>abs()</code> function for returning the absolute value of the numerical argument, see <a href="/5.6.1/perlfunc#abs">"abs" in perlfunc</a>.</p> </dd> <dt id="fclose"><a class="permalink" href="#fclose">#</a>fclose</dt> <dd> <p>Use method <code>IO::Handle::close()</code> instead, or see <a href="/5.6.1/perlfunc#close">"close" in perlfunc</a>.</p> </dd> <dt id="fcntl"><a class="permalink" href="#fcntl">#</a>fcntl</dt> <dd> <p>This is identical to Perl's builtin <code>fcntl()</code> function, see <a href="/5.6.1/perlfunc#fcntl">"fcntl" in perlfunc</a>.</p> </dd> <dt id="fdopen"><a class="permalink" href="#fdopen">#</a>fdopen</dt> <dd> <p>Use method <code>IO::Handle::new_from_fd()</code> instead, or see <a href="/5.6.1/perlfunc#open">"open" in perlfunc</a>.</p> </dd> <dt id="feof"><a class="permalink" href="#feof">#</a>feof</dt> <dd> <p>Use method <code>IO::Handle::eof()</code> instead, or see <a href="/5.6.1/perlfunc#eof">"eof" in perlfunc</a>.</p> </dd> <dt id="ferror"><a class="permalink" href="#ferror">#</a>ferror</dt> <dd> <p>Use method <code>IO::Handle::error()</code> instead.</p> </dd> <dt id="fflush"><a class="permalink" href="#fflush">#</a>fflush</dt> <dd> <p>Use method <code>IO::Handle::flush()</code> instead. See also <a href="/5.6.1/perlvar#%24OUTPUT_AUTOFLUSH">"$OUTPUT_AUTOFLUSH" in perlvar</a>.</p> </dd> <dt id="fgetc"><a class="permalink" href="#fgetc">#</a>fgetc</dt> <dd> <p>Use method <code>IO::Handle::getc()</code> instead, or see <a href="/5.6.1/perlfunc#read">"read" in perlfunc</a>.</p> </dd> <dt id="fgetpos"><a class="permalink" href="#fgetpos">#</a>fgetpos</dt> <dd> <p>Use method <code>IO::Seekable::getpos()</code> instead, or see <a href="/5.6.1/L#seek">"seek" in L</a>.</p> </dd> <dt id="fgets"><a class="permalink" href="#fgets">#</a>fgets</dt> <dd> <p>Use method <code>IO::Handle::gets()</code> instead. Similar to <>, also known as <a href="/5.6.1/perlfunc#readline">"readline" in perlfunc</a>.</p> </dd> <dt id="fileno"><a class="permalink" href="#fileno">#</a>fileno</dt> <dd> <p>Use method <code>IO::Handle::fileno()</code> instead, or see <a href="/5.6.1/perlfunc#fileno">"fileno" in perlfunc</a>.</p> </dd> <dt id="floor"><a class="permalink" href="#floor">#</a>floor</dt> <dd> <p>This is identical to the C function <code>floor()</code>, returning the largest integer value less than or equal to the numerical argument.</p> </dd> <dt id="fmod"><a class="permalink" href="#fmod">#</a>fmod</dt> <dd> <p>This is identical to the C function <code>fmod()</code>.</p> <pre><code>$r = modf($x, $y);</code></pre> <p>It returns the remainder <code>$r = $x - $n*$y</code>, where <code>$n = trunc($x/$y)</code>. The <code>$r</code> has the same sign as <code>$x</code> and magnitude (absolute value) less than the magnitude of <code>$y</code>.</p> </dd> <dt id="fopen"><a class="permalink" href="#fopen">#</a>fopen</dt> <dd> <p>Use method <code>IO::File::open()</code> instead, or see <a href="/5.6.1/perlfunc#open">"open" in perlfunc</a>.</p> </dd> <dt id="fork"><a class="permalink" href="#fork">#</a>fork</dt> <dd> <p>This is identical to Perl's builtin <code>fork()</code> function for duplicating the current process, see <a href="/5.6.1/perlfunc#fork">"fork" in perlfunc</a> and <a href="/5.6.1/perlfork">perlfork</a> if you are in Windows.</p> </dd> <dt id="fpathconf"><a class="permalink" href="#fpathconf">#</a>fpathconf</dt> <dd> <p>Retrieves the value of a configurable limit on a file or directory. This uses file descriptors such as those obtained by calling <code>POSIX::open</code>.</p> <p>The following will determine the maximum length of the longest allowable pathname on the filesystem which holds <code>/tmp/foo</code>.</p> <pre><code>$fd = POSIX::open( "/tmp/foo", &POSIX::O_RDONLY ); $path_max = POSIX::fpathconf( $fd, &POSIX::_PC_PATH_MAX );</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="fprintf"><a class="permalink" href="#fprintf">#</a>fprintf</dt> <dd> <p>fprintf() is C-specific, see <a href="/5.6.1/perlfunc#printf">"printf" in perlfunc</a> instead.</p> </dd> <dt id="fputc"><a class="permalink" href="#fputc">#</a>fputc</dt> <dd> <p>fputc() is C-specific, see <a href="/5.6.1/perlfunc#print">"print" in perlfunc</a> instead.</p> </dd> <dt id="fputs"><a class="permalink" href="#fputs">#</a>fputs</dt> <dd> <p>fputs() is C-specific, see <a href="/5.6.1/perlfunc#print">"print" in perlfunc</a> instead.</p> </dd> <dt id="fread"><a class="permalink" href="#fread">#</a>fread</dt> <dd> <p>fread() is C-specific, see <a href="/5.6.1/perlfunc#read">"read" in perlfunc</a> instead.</p> </dd> <dt id="free"><a class="permalink" href="#free">#</a>free</dt> <dd> <p>free() is C-specific. Perl does memory management transparently.</p> </dd> <dt id="freopen"><a class="permalink" href="#freopen">#</a>freopen</dt> <dd> <p>freopen() is C-specific, see <a href="/5.6.1/perlfunc#open">"open" in perlfunc</a> instead.</p> </dd> <dt id="frexp"><a class="permalink" href="#frexp">#</a>frexp</dt> <dd> <p>Return the mantissa and exponent of a floating-point number.</p> <pre><code>($mantissa, $exponent) = POSIX::frexp( 1.234e56 );</code></pre> </dd> <dt id="fscanf"><a class="permalink" href="#fscanf">#</a>fscanf</dt> <dd> <p>fscanf() is C-specific, use <> and regular expressions instead.</p> </dd> <dt id="fseek"><a class="permalink" href="#fseek">#</a>fseek</dt> <dd> <p>Use method <code>IO::Seekable::seek()</code> instead, or see <a href="/5.6.1/perlfunc#seek">"seek" in perlfunc</a>.</p> </dd> <dt id="fsetpos"><a class="permalink" href="#fsetpos">#</a>fsetpos</dt> <dd> <p>Use method <code>IO::Seekable::setpos()</code> instead, or seek <a href="/5.6.1/perlfunc#seek">"seek" in perlfunc</a>.</p> </dd> <dt id="fstat"><a class="permalink" href="#fstat">#</a>fstat</dt> <dd> <p>Get file status. This uses file descriptors such as those obtained by calling <code>POSIX::open</code>. The data returned is identical to the data from Perl's builtin <code>stat</code> function.</p> <pre><code>$fd = POSIX::open( "foo", &POSIX::O_RDONLY ); @stats = POSIX::fstat( $fd );</code></pre> </dd> <dt id="ftell"><a class="permalink" href="#ftell">#</a>ftell</dt> <dd> <p>Use method <code>IO::Seekable::tell()</code> instead, or see <a href="/5.6.1/perlfunc#tell">"tell" in perlfunc</a>.</p> </dd> <dt id="fwrite"><a class="permalink" href="#fwrite">#</a>fwrite</dt> <dd> <p>fwrite() is C-specific, see <a href="/5.6.1/perlfunc#print">"print" in perlfunc</a> instead.</p> </dd> <dt id="getc"><a class="permalink" href="#getc">#</a>getc</dt> <dd> <p>This is identical to Perl's builtin <code>getc()</code> function, see <a href="/5.6.1/perlfunc#getc">"getc" in perlfunc</a>.</p> </dd> <dt id="getchar"><a class="permalink" href="#getchar">#</a>getchar</dt> <dd> <p>Returns one character from STDIN. Identical to Perl's <code>getc()</code>, see <a href="/5.6.1/perlfunc#getc">"getc" in perlfunc</a>.</p> </dd> <dt id="getcwd"><a class="permalink" href="#getcwd">#</a>getcwd</dt> <dd> <p>Returns the name of the current working directory. See also <a href="/5.6.1/Cwd">Cwd</a>.</p> </dd> <dt id="getegid"><a class="permalink" href="#getegid">#</a>getegid</dt> <dd> <p>Returns the effective group identifier. Similar to Perl' s builtin variable <code>$(</code>, see <a href="/5.6.1/perlvar#%24EGID">"$EGID" in perlvar</a>.</p> </dd> <dt id="getenv"><a class="permalink" href="#getenv">#</a>getenv</dt> <dd> <p>Returns the value of the specified enironment variable. The same information is available through the <code>%ENV</code> array.</p> </dd> <dt id="geteuid"><a class="permalink" href="#geteuid">#</a>geteuid</dt> <dd> <p>Returns the effective user identifier. Identical to Perl's builtin <code>$></code> variable, see <a href="/5.6.1/perlvar#%24EUID">"$EUID" in perlvar</a>.</p> </dd> <dt id="getgid"><a class="permalink" href="#getgid">#</a>getgid</dt> <dd> <p>Returns the user's real group identifier. Similar to Perl's builtin variable <code>$)</code>, see <a href="/5.6.1/perlvar#%24GID">"$GID" in perlvar</a>.</p> </dd> <dt id="getgrgid"><a class="permalink" href="#getgrgid">#</a>getgrgid</dt> <dd> <p>This is identical to Perl's builtin <code>getgrgid()</code> function for returning group entries by group identifiers, see <a href="/5.6.1/perlfunc#getgrgid">"getgrgid" in perlfunc</a>.</p> </dd> <dt id="getgrnam"><a class="permalink" href="#getgrnam">#</a>getgrnam</dt> <dd> <p>This is identical to Perl's builtin <code>getgrnam()</code> function for returning group entries by group names, see <a href="/5.6.1/perlfunc#getgrnam">"getgrnam" in perlfunc</a>.</p> </dd> <dt id="getgroups"><a class="permalink" href="#getgroups">#</a>getgroups</dt> <dd> <p>Returns the ids of the user's supplementary groups. Similar to Perl's builtin variable <code>$)</code>, see <a href="/5.6.1/perlvar#%24GID">"$GID" in perlvar</a>.</p> </dd> <dt id="getlogin"><a class="permalink" href="#getlogin">#</a>getlogin</dt> <dd> <p>This is identical to Perl's builtin <code>getlogin()</code> function for returning the user name associated with the current session, see <a href="/5.6.1/perlfunc#getlogin">"getlogin" in perlfunc</a>.</p> </dd> <dt id="getpgrp"><a class="permalink" href="#getpgrp">#</a>getpgrp</dt> <dd> <p>This is identical to Perl's builtin <code>getpgrp()</code> function for returning the prcess group identifier of the current process, see <a href="/5.6.1/perlfunc#getpgrp">"getpgrp" in perlfunc</a>.</p> </dd> <dt id="getpid"><a class="permalink" href="#getpid">#</a>getpid</dt> <dd> <p>Returns the process identifier. Identical to Perl's builtin variable <code>$$</code>, see <a href="/5.6.1/perlvar#%24PID">"$PID" in perlvar</a>.</p> </dd> <dt id="getppid"><a class="permalink" href="#getppid">#</a>getppid</dt> <dd> <p>This is identical to Perl's builtin <code>getppid()</code> function for returning the process identifier of the parent process of the current process , see <a href="/5.6.1/perlfunc#getppid">"getppid" in perlfunc</a>.</p> </dd> <dt id="getpwnam"><a class="permalink" href="#getpwnam">#</a>getpwnam</dt> <dd> <p>This is identical to Perl's builtin <code>getpwnam()</code> function for returning user entries by user names, see <a href="/5.6.1/perlfunc#getpwnam">"getpwnam" in perlfunc</a>.</p> </dd> <dt id="getpwuid"><a class="permalink" href="#getpwuid">#</a>getpwuid</dt> <dd> <p>This is identical to Perl's builtin <code>getpwuid()</code> function for returning user entries by user identifiers, see <a href="/5.6.1/perlfunc#getpwuid">"getpwuid" in perlfunc</a>.</p> </dd> <dt id="gets"><a class="permalink" href="#gets">#</a>gets</dt> <dd> <p>Returns one line from <code>STDIN</code>, similar to <>, also known as the <code>readline()</code> function, see <a href="/5.6.1/perlfunc#readline">"readline" in perlfunc</a>.</p> <p><b>NOTE</b>: if you have C programs that still use <code>gets()</code>, be very afraid. The <code>gets()</code> function is a source of endless grief because it has no buffer overrun checks. It should <b>never</b> be used. The <code>fgets()</code> function should be preferred instead.</p> </dd> <dt id="getuid"><a class="permalink" href="#getuid">#</a>getuid</dt> <dd> <p>Returns the user's identifier. Identical to Perl's builtin <code>$<</code> variable, see <a href="/5.6.1/perlvar#%24UID">"$UID" in perlvar</a>.</p> </dd> <dt id="gmtime"><a class="permalink" href="#gmtime">#</a>gmtime</dt> <dd> <p>This is identical to Perl's builtin <code>gmtime()</code> function for converting seconds since the epoch to a date in Greenwich Mean Time, see <a href="/5.6.1/perlfunc#gmtime">"gmtime" in perlfunc</a>.</p> </dd> <dt id="isalnum"><a class="permalink" href="#isalnum">#</a>isalnum</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:isalnum:]]/</code> construct instead, or possibly the <code>/\w/</code> construct.</p> </dd> <dt id="isalpha"><a class="permalink" href="#isalpha">#</a>isalpha</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:isalpha:]]/</code> construct instead.</p> </dd> <dt id="isatty"><a class="permalink" href="#isatty">#</a>isatty</dt> <dd> <p>Returns a boolean indicating whether the specified filehandle is connected to a tty. Similar to the <code>-t</code> operator, see <a href="/5.6.1/perlfunc#-X">"-X" in perlfunc</a>.</p> </dd> <dt id="iscntrl"><a class="permalink" href="#iscntrl">#</a>iscntrl</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:iscntrl:]]/</code> construct instead.</p> </dd> <dt id="isdigit"><a class="permalink" href="#isdigit">#</a>isdigit</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:isdigit:]]/</code> construct instead, or the <code>/\d/</code> construct.</p> </dd> <dt id="isgraph"><a class="permalink" href="#isgraph">#</a>isgraph</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:isgraph:]]/</code> construct instead.</p> </dd> <dt id="islower"><a class="permalink" href="#islower">#</a>islower</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:islower:]]/</code> construct instead. Do <b>not</b> use <code>/a-z/</code>.</p> </dd> <dt id="isprint"><a class="permalink" href="#isprint">#</a>isprint</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:isprint:]]/</code> construct instead.</p> </dd> <dt id="ispunct"><a class="permalink" href="#ispunct">#</a>ispunct</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:ispunct:]]/</code> construct instead.</p> </dd> <dt id="isspace"><a class="permalink" href="#isspace">#</a>isspace</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:isspace:]]/</code> construct instead, or the <code>/\s/</code> construct.</p> </dd> <dt id="isupper"><a class="permalink" href="#isupper">#</a>isupper</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:isupper:]]/</code> construct instead. Do <b>not</b> use <code>/A-Z/</code>.</p> </dd> <dt id="isxdigit"><a class="permalink" href="#isxdigit">#</a>isxdigit</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using regular expressions and the <code>/[[:isxdigit:]]/</code> construct instead, or simply <code>/[0-9a-f]/i</code>.</p> </dd> <dt id="kill"><a class="permalink" href="#kill">#</a>kill</dt> <dd> <p>This is identical to Perl's builtin <code>kill()</code> function for sending signals to processes (often to terminate them), see <a href="/5.6.1/perlfunc#kill">"kill" in perlfunc</a>.</p> </dd> <dt id="labs"><a class="permalink" href="#labs">#</a>labs</dt> <dd> <p>(For returning absolute values of long integers.) labs() is C-specific, see <a href="/5.6.1/perlfunc#abs">"abs" in perlfunc</a> instead.</p> </dd> <dt id="ldexp"><a class="permalink" href="#ldexp">#</a>ldexp</dt> <dd> <p>This is identical to the C function <code>ldexp()</code> for multiplying floating point numbers with powers of two.</p> <pre><code>$x_quadrupled = POSIX::ldexp($x, 2);</code></pre> </dd> <dt id="ldiv"><a class="permalink" href="#ldiv">#</a>ldiv</dt> <dd> <p>(For computing dividends of long integers.) ldiv() is C-specific, use <code>/</code> and <code>int()</code> instead.</p> </dd> <dt id="link"><a class="permalink" href="#link">#</a>link</dt> <dd> <p>This is identical to Perl's builtin <code>link()</code> function for creating hard links into files, see <a href="/5.6.1/perlfunc#link">"link" in perlfunc</a>.</p> </dd> <dt id="localeconv"><a class="permalink" href="#localeconv">#</a>localeconv</dt> <dd> <p>Get numeric formatting information. Returns a reference to a hash containing the current locale formatting values.</p> <p>Here is how to query the database for the <b>de</b> (Deutsch or German) locale.</p> <pre><code>$loc = POSIX::setlocale( &POSIX::LC_ALL, "de" ); print "Locale = $loc\n"; $lconv = POSIX::localeconv(); print "decimal_point = ", $lconv->{decimal_point}, "\n"; print "thousands_sep = ", $lconv->{thousands_sep}, "\n"; print "grouping = ", $lconv->{grouping}, "\n"; print "int_curr_symbol = ", $lconv->{int_curr_symbol}, "\n"; print "currency_symbol = ", $lconv->{currency_symbol}, "\n"; print "mon_decimal_point = ", $lconv->{mon_decimal_point}, "\n"; print "mon_thousands_sep = ", $lconv->{mon_thousands_sep}, "\n"; print "mon_grouping = ", $lconv->{mon_grouping}, "\n"; print "positive_sign = ", $lconv->{positive_sign}, "\n"; print "negative_sign = ", $lconv->{negative_sign}, "\n"; print "int_frac_digits = ", $lconv->{int_frac_digits}, "\n"; print "frac_digits = ", $lconv->{frac_digits}, "\n"; print "p_cs_precedes = ", $lconv->{p_cs_precedes}, "\n"; print "p_sep_by_space = ", $lconv->{p_sep_by_space}, "\n"; print "n_cs_precedes = ", $lconv->{n_cs_precedes}, "\n"; print "n_sep_by_space = ", $lconv->{n_sep_by_space}, "\n"; print "p_sign_posn = ", $lconv->{p_sign_posn}, "\n"; print "n_sign_posn = ", $lconv->{n_sign_posn}, "\n";</code></pre> </dd> <dt id="localtime"><a class="permalink" href="#localtime">#</a>localtime</dt> <dd> <p>This is identical to Perl's builtin <code>localtime()</code> function for converting seconds since the epoch to a date see <a href="/5.6.1/perlfunc#localtime">"localtime" in perlfunc</a>.</p> </dd> <dt id="log"><a class="permalink" href="#log">#</a>log</dt> <dd> <p>This is identical to Perl's builtin <code>log()</code> function, returning the natural (<i>e</i>-based) logarithm of the numerical argument, see <a href="/5.6.1/perlfunc#log">"log" in perlfunc</a>.</p> </dd> <dt id="log10"><a class="permalink" href="#log10">#</a>log10</dt> <dd> <p>This is identical to the C function <code>log10()</code>, returning the 10-base logarithm of the numerical argument. You can also use</p> <pre><code>sub log10 { log($_[0]) / log(10) }</code></pre> <p>or</p> <pre><code>sub log10 { log($_[0]) / 2.30258509299405 } </code></pre> <p>or</p> <pre><code>sub log10 { log($_[0]) * 0.434294481903252 }</code></pre> </dd> <dt id="longjmp"><a class="permalink" href="#longjmp">#</a>longjmp</dt> <dd> <p>longjmp() is C-specific: use <a href="/5.6.1/perlfunc#die">"die" in perlfunc</a> instead.</p> </dd> <dt id="lseek"><a class="permalink" href="#lseek">#</a>lseek</dt> <dd> <p>Move the file's read/write position. This uses file descriptors such as those obtained by calling <code>POSIX::open</code>.</p> <pre><code>$fd = POSIX::open( "foo", &POSIX::O_RDONLY ); $off_t = POSIX::lseek( $fd, 0, &POSIX::SEEK_SET );</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="malloc"><a class="permalink" href="#malloc">#</a>malloc</dt> <dd> <p>malloc() is C-specific. Perl does memory management transparently.</p> </dd> <dt id="mblen"><a class="permalink" href="#mblen">#</a>mblen</dt> <dd> <p>This is identical to the C function <code>mblen()</code>. Perl does not have any support for the wide and multibyte characters of the C standards, so this might be a rather useless function.</p> </dd> <dt id="mbstowcs"><a class="permalink" href="#mbstowcs">#</a>mbstowcs</dt> <dd> <p>This is identical to the C function <code>mbstowcs()</code>. Perl does not have any support for the wide and multibyte characters of the C standards, so this might be a rather useless function.</p> </dd> <dt id="mbtowc"><a class="permalink" href="#mbtowc">#</a>mbtowc</dt> <dd> <p>This is identical to the C function <code>mbtowc()</code>. Perl does not have any support for the wide and multibyte characters of the C standards, so this might be a rather useless function.</p> </dd> <dt id="memchr"><a class="permalink" href="#memchr">#</a>memchr</dt> <dd> <p>memchr() is C-specific, see <a href="/5.6.1/perlfunc#index">"index" in perlfunc</a> instead.</p> </dd> <dt id="memcmp"><a class="permalink" href="#memcmp">#</a>memcmp</dt> <dd> <p>memcmp() is C-specific, use <code>eq</code> instead, see <a href="/5.6.1/perlop">perlop</a>.</p> </dd> <dt id="memcpy"><a class="permalink" href="#memcpy">#</a>memcpy</dt> <dd> <p>memcpy() is C-specific, use <code>=</code>, see <a href="/5.6.1/perlop">perlop</a>, or see <a href="/5.6.1/perlfunc#substr">"substr" in perlfunc</a>.</p> </dd> <dt id="memmove"><a class="permalink" href="#memmove">#</a>memmove</dt> <dd> <p>memmove() is C-specific, use <code>=</code>, see <a href="/5.6.1/perlop">perlop</a>, or see <a href="/5.6.1/perlfunc#substr">"substr" in perlfunc</a>.</p> </dd> <dt id="memset"><a class="permalink" href="#memset">#</a>memset</dt> <dd> <p>memset() is C-specific, use <code>x</code> instead, see <a href="/5.6.1/perlop">perlop</a>.</p> </dd> <dt id="mkdir"><a class="permalink" href="#mkdir">#</a>mkdir</dt> <dd> <p>This is identical to Perl's builtin <code>mkdir()</code> function for creating directories, see <a href="/5.6.1/perlfunc#mkdir">"mkdir" in perlfunc</a>.</p> </dd> <dt id="mkfifo"><a class="permalink" href="#mkfifo">#</a>mkfifo</dt> <dd> <p>This is similar to the C function <code>mkfifo()</code> for creating FIFO special files.</p> <pre><code>if (mkfifo($path, $mode)) { ....</code></pre> <p>Returns <code>undef</code> on failure. The <code>$mode</code> is similar to the mode of <code>mkdir()</code>, see <a href="/5.6.1/perlfunc#mkdir">"mkdir" in perlfunc</a>.</p> </dd> <dt id="mktime"><a class="permalink" href="#mktime">#</a>mktime</dt> <dd> <p>Convert date/time info to a calendar time.</p> <p>Synopsis:</p> <pre><code class="plaintext">mktime(sec, min, hour, mday, mon, year, wday = 0, yday = 0, isdst = 0)</code></pre> <p>The month (<code>mon</code>), weekday (<code>wday</code>), and yearday (<code>yday</code>) begin at zero. I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The year (<code>year</code>) is given in years since 1900. I.e. The year 1995 is 95; the year 2001 is 101. Consult your system's <code>mktime()</code> manpage for details about these and the other arguments.</p> <p>Calendar time for December 12, 1995, at 10:30 am.</p> <pre><code>$time_t = POSIX::mktime( 0, 30, 10, 12, 11, 95 ); print "Date = ", POSIX::ctime($time_t);</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="modf"><a class="permalink" href="#modf">#</a>modf</dt> <dd> <p>Return the integral and fractional parts of a floating-point number.</p> <pre><code>($fractional, $integral) = POSIX::modf( 3.14 );</code></pre> </dd> <dt id="nice"><a class="permalink" href="#nice">#</a>nice</dt> <dd> <p>This is similar to the C function <code>nice()</code>, for changing the scheduling preference of the current process. Positive arguments mean more polite process, negative values more needy process. Normal user processes can only be more polite.</p> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="offsetof"><a class="permalink" href="#offsetof">#</a>offsetof</dt> <dd> <p>offsetof() is C-specific, you probably want to see <a href="/5.6.1/perlfunc#pack">"pack" in perlfunc</a> instead.</p> </dd> <dt id="open"><a class="permalink" href="#open">#</a>open</dt> <dd> <p>Open a file for reading for writing. This returns file descriptors, not Perl filehandles. Use <code>POSIX::close</code> to close the file.</p> <p>Open a file read-only with mode 0666.</p> <pre><code>$fd = POSIX::open( "foo" );</code></pre> <p>Open a file for read and write.</p> <pre><code>$fd = POSIX::open( "foo", &POSIX::O_RDWR );</code></pre> <p>Open a file for write, with truncation.</p> <pre><code>$fd = POSIX::open( "foo", &POSIX::O_WRONLY | &POSIX::O_TRUNC );</code></pre> <p>Create a new file with mode 0640. Set up the file for writing.</p> <pre><code>$fd = POSIX::open( "foo", &POSIX::O_CREAT | &POSIX::O_WRONLY, 0640 );</code></pre> <p>Returns <code>undef</code> on failure.</p> <p>See also <a href="/5.6.1/perlfunc#sysopen">"sysopen" in perlfunc</a>.</p> </dd> <dt id="opendir"><a class="permalink" href="#opendir">#</a>opendir</dt> <dd> <p>Open a directory for reading.</p> <pre><code>$dir = POSIX::opendir( "/tmp" ); @files = POSIX::readdir( $dir ); POSIX::closedir( $dir );</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="pathconf"><a class="permalink" href="#pathconf">#</a>pathconf</dt> <dd> <p>Retrieves the value of a configurable limit on a file or directory.</p> <p>The following will determine the maximum length of the longest allowable pathname on the filesystem which holds <code>/tmp</code>.</p> <pre><code>$path_max = POSIX::pathconf( "/tmp", &POSIX::_PC_PATH_MAX );</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="pause"><a class="permalink" href="#pause">#</a>pause</dt> <dd> <p>This is similar to the C function <code>pause()</code>, which suspends the execution of the current process until a signal is received.</p> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="perror"><a class="permalink" href="#perror">#</a>perror</dt> <dd> <p>This is identical to the C function <code>perror()</code>, which outputs to the standard error stream the specified message followed by ": " and the current error string. Use the <code>warn()</code> function and the <code>$!</code> variable instead, see <a href="/5.6.1/perlfunc#warn">"warn" in perlfunc</a> and <a href="/5.6.1/perlvar#%24ERRNO">"$ERRNO" in perlvar</a>.</p> </dd> <dt id="pipe"><a class="permalink" href="#pipe">#</a>pipe</dt> <dd> <p>Create an interprocess channel. This returns file descriptors like those returned by <code>POSIX::open</code>.</p> <pre><code>($fd0, $fd1) = POSIX::pipe(); POSIX::write( $fd0, "hello", 5 ); POSIX::read( $fd1, $buf, 5 );</code></pre> <p>See also <a href="/5.6.1/perlfunc#pipe">"pipe" in perlfunc</a>.</p> </dd> <dt id="pow"><a class="permalink" href="#pow">#</a>pow</dt> <dd> <p>Computes <code>$x</code> raised to the power <code>$exponent</code>.</p> <pre><code>$ret = POSIX::pow( $x, $exponent );</code></pre> <p>You can also use the <code>**</code> operator, see <a href="/5.6.1/perlop">perlop</a>.</p> </dd> <dt id="printf"><a class="permalink" href="#printf">#</a>printf</dt> <dd> <p>Formats and prints the specified arguments to STDOUT. See also <a href="/5.6.1/perlfunc#printf">"printf" in perlfunc</a>.</p> </dd> <dt id="putc"><a class="permalink" href="#putc">#</a>putc</dt> <dd> <p>putc() is C-specific, see <a href="/5.6.1/perlfunc#print">"print" in perlfunc</a> instead.</p> </dd> <dt id="putchar"><a class="permalink" href="#putchar">#</a>putchar</dt> <dd> <p>putchar() is C-specific, see <a href="/5.6.1/perlfunc#print">"print" in perlfunc</a> instead.</p> </dd> <dt id="puts"><a class="permalink" href="#puts">#</a>puts</dt> <dd> <p>puts() is C-specific, see <a href="/5.6.1/perlfunc#print">"print" in perlfunc</a> instead.</p> </dd> <dt id="qsort"><a class="permalink" href="#qsort">#</a>qsort</dt> <dd> <p>qsort() is C-specific, see <a href="/5.6.1/perlfunc#sort">"sort" in perlfunc</a> instead.</p> </dd> <dt id="raise"><a class="permalink" href="#raise">#</a>raise</dt> <dd> <p>Sends the specified signal to the current process. See also <a href="/5.6.1/perlfunc#kill">"kill" in perlfunc</a> and the <code>$$</code> in <a href="/5.6.1/perlvar#%24PID">"$PID" in perlvar</a>.</p> </dd> <dt id="rand"><a class="permalink" href="#rand">#</a>rand</dt> <dd> <p><code>rand()</code> is non-portable, see <a href="/5.6.1/perlfunc#rand">"rand" in perlfunc</a> instead.</p> </dd> <dt id="read"><a class="permalink" href="#read">#</a>read</dt> <dd> <p>Read from a file. This uses file descriptors such as those obtained by calling <code>POSIX::open</code>. If the buffer <code>$buf</code> is not large enough for the read then Perl will extend it to make room for the request.</p> <pre><code>$fd = POSIX::open( "foo", &POSIX::O_RDONLY ); $bytes = POSIX::read( $fd, $buf, 3 );</code></pre> <p>Returns <code>undef</code> on failure.</p> <p>See also <a href="/5.6.1/perlfunc#sysread">"sysread" in perlfunc</a>.</p> </dd> <dt id="readdir"><a class="permalink" href="#readdir">#</a>readdir</dt> <dd> <p>This is identical to Perl's builtin <code>readdir()</code> function for reading directory entries, see <a href="/5.6.1/perlfunc#readdir">"readdir" in perlfunc</a>.</p> </dd> <dt id="realloc"><a class="permalink" href="#realloc">#</a>realloc</dt> <dd> <p>realloc() is C-specific. Perl does memory management transparently.</p> </dd> <dt id="remove"><a class="permalink" href="#remove">#</a>remove</dt> <dd> <p>This is identical to Perl's builtin <code>unlink()</code> function for removing files, see <a href="/5.6.1/perlfunc#unlink">"unlink" in perlfunc</a>.</p> </dd> <dt id="rename"><a class="permalink" href="#rename">#</a>rename</dt> <dd> <p>This is identical to Perl's builtin <code>rename()</code> function for renaming files, see <a href="/5.6.1/perlfunc#rename">"rename" in perlfunc</a>.</p> </dd> <dt id="rewind"><a class="permalink" href="#rewind">#</a>rewind</dt> <dd> <p>Seeks to the beginning of the file.</p> </dd> <dt id="rewinddir"><a class="permalink" href="#rewinddir">#</a>rewinddir</dt> <dd> <p>This is identical to Perl's builtin <code>rewinddir()</code> function for rewinding directory entry streams, see <a href="/5.6.1/perlfunc#rewinddir">"rewinddir" in perlfunc</a>.</p> </dd> <dt id="rmdir"><a class="permalink" href="#rmdir">#</a>rmdir</dt> <dd> <p>This is identical to Perl's builtin <code>rmdir()</code> function for removing (empty) directories, see <a href="/5.6.1/perlfunc#rmdir">"rmdir" in perlfunc</a>.</p> </dd> <dt id="scanf"><a class="permalink" href="#scanf">#</a>scanf</dt> <dd> <p>scanf() is C-specific, use <> and regular expressions instead, see <a href="/5.6.1/perlre">perlre</a>.</p> </dd> <dt id="setgid"><a class="permalink" href="#setgid">#</a>setgid</dt> <dd> <p>Sets the real group identifier for this process. Identical to assigning a value to the Perl's builtin <code>$)</code> variable, see <a href="/5.6.1/perlvar#%24UID">"$UID" in perlvar</a>.</p> </dd> <dt id="setjmp"><a class="permalink" href="#setjmp">#</a>setjmp</dt> <dd> <p><code>setjmp()</code> is C-specific: use <code>eval {}</code> instead, see <a href="/5.6.1/perlfunc#eval">"eval" in perlfunc</a>.</p> </dd> <dt id="setlocale"><a class="permalink" href="#setlocale">#</a>setlocale</dt> <dd> <p>Modifies and queries program's locale. The following examples assume</p> <pre><code>use POSIX qw(setlocale LC_ALL LC_CTYPE);</code></pre> <p>has been issued.</p> <p>The following will set the traditional UNIX system locale behavior (the second argument <code>"C"</code>).</p> <pre><code>$loc = setlocale( LC_ALL, "C" );</code></pre> <p>The following will query the current LC_CTYPE category. (No second argument means 'query'.)</p> <pre><code>$loc = setlocale( LC_CTYPE );</code></pre> <p>The following will set the LC_CTYPE behaviour according to the locale environment variables (the second argument <code>""</code>). Please see your systems <a href="http://man.he.net/man3/setlocale">setlocale(3)</a> documentation for the locale environment variables' meaning or consult <a href="/5.6.1/perllocale">perllocale</a>.</p> <pre><code>$loc = setlocale( LC_CTYPE, "" );</code></pre> <p>The following will set the LC_COLLATE behaviour to Argentinian Spanish. <b>NOTE</b>: The naming and availability of locales depends on your operating system. Please consult <a href="/5.6.1/perllocale">perllocale</a> for how to find out which locales are available in your system.</p> <pre><code>$loc = setlocale( LC_ALL, "es_AR.ISO8859-1" );</code></pre> </dd> <dt id="setpgid"><a class="permalink" href="#setpgid">#</a>setpgid</dt> <dd> <p>This is similar to the C function <code>setpgid()</code> for setting the process group identifier of the current process.</p> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="setsid"><a class="permalink" href="#setsid">#</a>setsid</dt> <dd> <p>This is identical to the C function <code>setsid()</code> for setting the session identifier of the current process.</p> </dd> <dt id="setuid"><a class="permalink" href="#setuid">#</a>setuid</dt> <dd> <p>Sets the real user identifier for this process. Identical to assigning a value to the Perl's builtin <code>$<</code> variable, see <a href="/5.6.1/perlvar#%24UID">"$UID" in perlvar</a>.</p> </dd> <dt id="sigaction"><a class="permalink" href="#sigaction">#</a>sigaction</dt> <dd> <p>Detailed signal management. This uses <code>POSIX::SigAction</code> objects for the <code>action</code> and <code>oldaction</code> arguments. Consult your system's <code>sigaction</code> manpage for details.</p> <p>Synopsis:</p> <pre><code class="plaintext">sigaction(sig, action, oldaction = 0)</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="siglongjmp"><a class="permalink" href="#siglongjmp">#</a>siglongjmp</dt> <dd> <p>siglongjmp() is C-specific: use <a href="/5.6.1/perlfunc#die">"die" in perlfunc</a> instead.</p> </dd> <dt id="sigpending"><a class="permalink" href="#sigpending">#</a>sigpending</dt> <dd> <p>Examine signals that are blocked and pending. This uses <code>POSIX::SigSet</code> objects for the <code>sigset</code> argument. Consult your system's <code>sigpending</code> manpage for details.</p> <p>Synopsis:</p> <pre><code class="plaintext">sigpending(sigset)</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="sigprocmask"><a class="permalink" href="#sigprocmask">#</a>sigprocmask</dt> <dd> <p>Change and/or examine calling process's signal mask. This uses <code>POSIX::SigSet</code> objects for the <code>sigset</code> and <code>oldsigset</code> arguments. Consult your system's <code>sigprocmask</code> manpage for details.</p> <p>Synopsis:</p> <pre><code class="plaintext">sigprocmask(how, sigset, oldsigset = 0)</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="sigsetjmp"><a class="permalink" href="#sigsetjmp">#</a>sigsetjmp</dt> <dd> <p><code>sigsetjmp()</code> is C-specific: use <code>eval {}</code> instead, see <a href="/5.6.1/perlfunc#eval">"eval" in perlfunc</a>.</p> </dd> <dt id="sigsuspend"><a class="permalink" href="#sigsuspend">#</a>sigsuspend</dt> <dd> <p>Install a signal mask and suspend process until signal arrives. This uses <code>POSIX::SigSet</code> objects for the <code>signal_mask</code> argument. Consult your system's <code>sigsuspend</code> manpage for details.</p> <p>Synopsis:</p> <pre><code class="plaintext">sigsuspend(signal_mask)</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="sin"><a class="permalink" href="#sin">#</a>sin</dt> <dd> <p>This is identical to Perl's builtin <code>sin()</code> function for returning the sine of the numerical argument, see <a href="/5.6.1/perlfunc#sin">"sin" in perlfunc</a>. See also <a href="/5.6.1/Math::Trig">Math::Trig</a>.</p> </dd> <dt id="sinh"><a class="permalink" href="#sinh">#</a>sinh</dt> <dd> <p>This is identical to the C function <code>sinh()</code> for returning the hyperbolic sine of the numerical argument. See also <a href="/5.6.1/Math::Trig">Math::Trig</a>.</p> </dd> <dt id="sleep"><a class="permalink" href="#sleep">#</a>sleep</dt> <dd> <p>This is identical to Perl's builtin <code>sleep()</code> function for suspending the execution of the current for process for certain number of seconds, see <a href="/5.6.1/perlfunc#sleep">"sleep" in perlfunc</a>.</p> </dd> <dt id="sprintf"><a class="permalink" href="#sprintf">#</a>sprintf</dt> <dd> <p>This is similar to Perl's builtin <code>sprintf()</code> function for returning a string that has the arguments formatted as requested, see <a href="/5.6.1/perlfunc#sprintf">"sprintf" in perlfunc</a>.</p> </dd> <dt id="sqrt"><a class="permalink" href="#sqrt">#</a>sqrt</dt> <dd> <p>This is identical to Perl's builtin <code>sqrt()</code> function. for returning the square root of the numerical argument, see <a href="/5.6.1/perlfunc#sqrt">"sqrt" in perlfunc</a>.</p> </dd> <dt id="srand"><a class="permalink" href="#srand">#</a>srand</dt> <dd> <p>Give a seed the pseudorandom number generator, see <a href="/5.6.1/perlfunc#srand">"srand" in perlfunc</a>.</p> </dd> <dt id="sscanf"><a class="permalink" href="#sscanf">#</a>sscanf</dt> <dd> <p>sscanf() is C-specific, use regular expressions instead, see <a href="/5.6.1/perlre">perlre</a>.</p> </dd> <dt id="stat"><a class="permalink" href="#stat">#</a>stat</dt> <dd> <p>This is identical to Perl's builtin <code>stat()</code> function for retutning information about files and directories.</p> </dd> <dt id="strcat"><a class="permalink" href="#strcat">#</a>strcat</dt> <dd> <p>strcat() is C-specific, use <code>.=</code> instead, see <a href="/5.6.1/perlop">perlop</a>.</p> </dd> <dt id="strchr"><a class="permalink" href="#strchr">#</a>strchr</dt> <dd> <p>strchr() is C-specific, see <a href="/5.6.1/perlfunc#index">"index" in perlfunc</a> instead.</p> </dd> <dt id="strcmp"><a class="permalink" href="#strcmp">#</a>strcmp</dt> <dd> <p>strcmp() is C-specific, use <code>eq</code> or <code>cmp</code> instead, see <a href="/5.6.1/perlop">perlop</a>.</p> </dd> <dt id="strcoll"><a class="permalink" href="#strcoll">#</a>strcoll</dt> <dd> <p>This is identical to the C function <code>strcoll()</code> for collating (comparing) strings transformed using the <code>strxfrm()</code> function. Not really needed since Perl can do this transparently, see <a href="/5.6.1/perllocale">perllocale</a>.</p> </dd> <dt id="strcpy"><a class="permalink" href="#strcpy">#</a>strcpy</dt> <dd> <p>strcpy() is C-specific, use <code>=</code> instead, see <a href="/5.6.1/perlop">perlop</a>.</p> </dd> <dt id="strcspn"><a class="permalink" href="#strcspn">#</a>strcspn</dt> <dd> <p>strcspn() is C-specific, use regular expressions instead, see <a href="/5.6.1/perlre">perlre</a>.</p> </dd> <dt id="strerror"><a class="permalink" href="#strerror">#</a>strerror</dt> <dd> <p>Returns the error string for the specified errno. Identical to the string form of the <code>$!</code>, see <a href="/5.6.1/perlvar#%24ERRNO">"$ERRNO" in perlvar</a>.</p> </dd> <dt id="strftime"><a class="permalink" href="#strftime">#</a>strftime</dt> <dd> <p>Convert date and time information to string. Returns the string.</p> <p>Synopsis:</p> <pre><code class="plaintext">strftime(fmt, sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1)</code></pre> <p>The month (<code>mon</code>), weekday (<code>wday</code>), and yearday (<code>yday</code>) begin at zero. I.e. January is 0, not 1; Sunday is 0, not 1; January 1st is 0, not 1. The year (<code>year</code>) is given in years since 1900. I.e., the year 1995 is 95; the year 2001 is 101. Consult your system's <code>strftime()</code> manpage for details about these and the other arguments. If you want your code to be portable, your format (<code>fmt</code>) argument should use only the conversion specifiers defined by the ANSI C standard. These are <code>aAbBcdHIjmMpSUwWxXyYZ%</code>. The given arguments are made consistent as though by calling <code>mktime()</code> before calling your system's <code>strftime()</code> function, except that the <code>isdst</code> value is not affected.</p> <p>The string for Tuesday, December 12, 1995.</p> <pre><code>$str = POSIX::strftime( "%A, %B %d, %Y", 0, 0, 0, 12, 11, 95, 2 ); print "$str\n";</code></pre> </dd> <dt id="strlen"><a class="permalink" href="#strlen">#</a>strlen</dt> <dd> <p>strlen() is C-specific, use <code>length()</code> instead, see <a href="/5.6.1/perlfunc#length">"length" in perlfunc</a>.</p> </dd> <dt id="strncat"><a class="permalink" href="#strncat">#</a>strncat</dt> <dd> <p>strncat() is C-specific, use <code>.=</code> instead, see <a href="/5.6.1/perlop">perlop</a>.</p> </dd> <dt id="strncmp"><a class="permalink" href="#strncmp">#</a>strncmp</dt> <dd> <p>strncmp() is C-specific, use <code>eq</code> instead, see <a href="/5.6.1/perlop">perlop</a>.</p> </dd> <dt id="strncpy"><a class="permalink" href="#strncpy">#</a>strncpy</dt> <dd> <p>strncpy() is C-specific, use <code>=</code> instead, see <a href="/5.6.1/perlop">perlop</a>.</p> </dd> <dt id="strpbrk"><a class="permalink" href="#strpbrk">#</a>strpbrk</dt> <dd> <p>strpbrk() is C-specific, use regular expressions instead, see <a href="/5.6.1/perlre">perlre</a>.</p> </dd> <dt id="strrchr"><a class="permalink" href="#strrchr">#</a>strrchr</dt> <dd> <p>strrchr() is C-specific, see <a href="/5.6.1/perlfunc#rindex">"rindex" in perlfunc</a> instead.</p> </dd> <dt id="strspn"><a class="permalink" href="#strspn">#</a>strspn</dt> <dd> <p>strspn() is C-specific, use regular expressions instead, see <a href="/5.6.1/perlre">perlre</a>.</p> </dd> <dt id="strstr"><a class="permalink" href="#strstr">#</a>strstr</dt> <dd> <p>This is identical to Perl's builtin <code>index()</code> function, see <a href="/5.6.1/perlfunc#index">"index" in perlfunc</a>.</p> </dd> <dt id="strtod"><a class="permalink" href="#strtod">#</a>strtod</dt> <dd> <p>String to double translation. Returns the parsed number and the number of characters in the unparsed portion of the string. Truly POSIX-compliant systems set $! ($ERRNO) to indicate a translation error, so clear $! before calling strtod. However, non-POSIX systems may not check for overflow, and therefore will never set $!.</p> <p>strtod should respect any POSIX <i>setlocale()</i> settings.</p> <p>To parse a string $str as a floating point number use</p> <pre><code>$! = 0; ($num, $n_unparsed) = POSIX::strtod($str);</code></pre> <p>The second returned item and $! can be used to check for valid input:</p> <pre><code>if (($str eq '') || ($n_unparsed != 0) || !$!) { die "Non-numeric input $str" . $! ? ": $!\n" : "\n"; }</code></pre> <p>When called in a scalar context strtod returns the parsed number.</p> </dd> <dt id="strtok"><a class="permalink" href="#strtok">#</a>strtok</dt> <dd> <p>strtok() is C-specific, use regular expressions instead, see <a href="/5.6.1/perlre">perlre</a>, or <a href="/5.6.1/perlfunc#split">"split" in perlfunc</a>.</p> </dd> <dt id="strtol"><a class="permalink" href="#strtol">#</a>strtol</dt> <dd> <p>String to (long) integer translation. Returns the parsed number and the number of characters in the unparsed portion of the string. Truly POSIX-compliant systems set $! ($ERRNO) to indicate a translation error, so clear $! before calling strtol. However, non-POSIX systems may not check for overflow, and therefore will never set $!.</p> <p>strtol should respect any POSIX <i>setlocale()</i> settings.</p> <p>To parse a string $str as a number in some base $base use</p> <pre><code>$! = 0; ($num, $n_unparsed) = POSIX::strtol($str, $base);</code></pre> <p>The base should be zero or between 2 and 36, inclusive. When the base is zero or omitted strtol will use the string itself to determine the base: a leading "0x" or "0X" means hexadecimal; a leading "0" means octal; any other leading characters mean decimal. Thus, "1234" is parsed as a decimal number, "01234" as an octal number, and "0x1234" as a hexadecimal number.</p> <p>The second returned item and $! can be used to check for valid input:</p> <pre><code>if (($str eq '') || ($n_unparsed != 0) || !$!) { die "Non-numeric input $str" . $! ? ": $!\n" : "\n"; }</code></pre> <p>When called in a scalar context strtol returns the parsed number.</p> </dd> <dt id="strtoul"><a class="permalink" href="#strtoul">#</a>strtoul</dt> <dd> <p>String to unsigned (long) integer translation. strtoul() is identical to strtol() except that strtoul() only parses unsigned integers. See <a href="#strtol">"strtol"</a> for details.</p> <p>Note: Some vendors supply strtod() and strtol() but not strtoul(). Other vendors that do supply strtoul() parse "-1" as a valid value.</p> </dd> <dt id="strxfrm"><a class="permalink" href="#strxfrm">#</a>strxfrm</dt> <dd> <p>String transformation. Returns the transformed string.</p> <pre><code>$dst = POSIX::strxfrm( $src );</code></pre> <p>Used in conjunction with the <code>strcoll()</code> function, see <a href="#strcoll">"strcoll"</a>.</p> <p>Not really needed since Perl can do this transparently, see <a href="/5.6.1/perllocale">perllocale</a>.</p> </dd> <dt id="sysconf"><a class="permalink" href="#sysconf">#</a>sysconf</dt> <dd> <p>Retrieves values of system configurable variables.</p> <p>The following will get the machine's clock speed.</p> <pre><code>$clock_ticks = POSIX::sysconf( &POSIX::_SC_CLK_TCK );</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="system"><a class="permalink" href="#system">#</a>system</dt> <dd> <p>This is identical to Perl's builtin <code>system()</code> function, see <a href="/5.6.1/perlfunc#system">"system" in perlfunc</a>.</p> </dd> <dt id="tan"><a class="permalink" href="#tan">#</a>tan</dt> <dd> <p>This is identical to the C function <code>tan()</code>, returning the tangent of the numerical argument. See also <a href="/5.6.1/Math::Trig">Math::Trig</a>.</p> </dd> <dt id="tanh"><a class="permalink" href="#tanh">#</a>tanh</dt> <dd> <p>This is identical to the C function <code>tanh()</code>, returning the hyperbolic tangent of the numerical argument. See also <a href="/5.6.1/Math::Trig">Math::Trig</a>.</p> </dd> <dt id="tcdrain"><a class="permalink" href="#tcdrain">#</a>tcdrain</dt> <dd> <p>This is similar to the C function <code>tcdrain()</code> for draining the output queue of its argument stream.</p> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="tcflow"><a class="permalink" href="#tcflow">#</a>tcflow</dt> <dd> <p>This is similar to the C function <code>tcflow()</code> for controlling the flow of its argument stream.</p> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="tcflush"><a class="permalink" href="#tcflush">#</a>tcflush</dt> <dd> <p>This is similar to the C function <code>tcflush()</code> for flushing the I/O buffers of its argumeny stream.</p> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="tcgetpgrp"><a class="permalink" href="#tcgetpgrp">#</a>tcgetpgrp</dt> <dd> <p>This is identical to the C function <code>tcgetpgrp()</code> for returning the process group identifier of the foreground process group of the controlling terminal.</p> </dd> <dt id="tcsendbreak"><a class="permalink" href="#tcsendbreak">#</a>tcsendbreak</dt> <dd> <p>This is similar to the C function <code>tcsendbreak()</code> for sending a break on its argument stream.</p> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="tcsetpgrp"><a class="permalink" href="#tcsetpgrp">#</a>tcsetpgrp</dt> <dd> <p>This is similar to the C function <code>tcsetpgrp()</code> for setting the process group identifier of the foreground process group of the controlling terminal.</p> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="time"><a class="permalink" href="#time">#</a>time</dt> <dd> <p>This is identical to Perl's builtin <code>time()</code> function for returning the number of seconds since the epoch (whatever it is for the system), see <a href="/5.6.1/perlfunc#time">"time" in perlfunc</a>.</p> </dd> <dt id="times"><a class="permalink" href="#times">#</a>times</dt> <dd> <p>The times() function returns elapsed realtime since some point in the past (such as system startup), user and system times for this process, and user and system times used by child processes. All times are returned in clock ticks.</p> <pre><code>($realtime, $user, $system, $cuser, $csystem) = POSIX::times();</code></pre> <p>Note: Perl's builtin <code>times()</code> function returns four values, measured in seconds.</p> </dd> <dt id="tmpfile"><a class="permalink" href="#tmpfile">#</a>tmpfile</dt> <dd> <p>Use method <code>IO::File::new_tmpfile()</code> instead, or see <a href="/5.6.1/File::Temp">File::Temp</a>.</p> </dd> <dt id="tmpnam"><a class="permalink" href="#tmpnam">#</a>tmpnam</dt> <dd> <p>Returns a name for a temporary file.</p> <pre><code>$tmpfile = POSIX::tmpnam();</code></pre> <p>For security reasons, which are probably detailed in your system's documentation for the C library tmpnam() function, this interface should not be used; instead see <a href="/5.6.1/File::Temp">File::Temp</a>.</p> </dd> <dt id="tolower"><a class="permalink" href="#tolower">#</a>tolower</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using the <code>lc()</code> function, see <a href="/5.6.1/perlfunc#lc">"lc" in perlfunc</a>, or the equivalent <code>\L</code> operator inside doublequotish strings.</p> </dd> <dt id="toupper"><a class="permalink" href="#toupper">#</a>toupper</dt> <dd> <p>This is identical to the C function, except that it can apply to a single character or to a whole string. Consider using the <code>uc()</code> function, see <a href="/5.6.1/perlfunc#uc">"uc" in perlfunc</a>, or the equivalent <code>\U</code> operator inside doublequotish strings.</p> </dd> <dt id="ttyname"><a class="permalink" href="#ttyname">#</a>ttyname</dt> <dd> <p>This is identical to the C function <code>ttyname()</code> for returning the name of the current terminal.</p> </dd> <dt id="tzname"><a class="permalink" href="#tzname">#</a>tzname</dt> <dd> <p>Retrieves the time conversion information from the <code>tzname</code> variable.</p> <pre><code>POSIX::tzset(); ($std, $dst) = POSIX::tzname();</code></pre> </dd> <dt id="tzset"><a class="permalink" href="#tzset">#</a>tzset</dt> <dd> <p>This is identical to the C function <code>tzset()</code> for setting the current timezone based on the environment variable <code>TZ</code>, to be used by <code>ctime()</code>, <code>localtime()</code>, <code>mktime()</code>, and <code>strftime()</code> functions.</p> </dd> <dt id="umask"><a class="permalink" href="#umask">#</a>umask</dt> <dd> <p>This is identical to Perl's builtin <code>umask()</code> function for setting (and querying) the file creation permission mask, see <a href="/5.6.1/perlfunc#umask">"umask" in perlfunc</a>.</p> </dd> <dt id="uname"><a class="permalink" href="#uname">#</a>uname</dt> <dd> <p>Get name of current operating system.</p> <pre><code>($sysname, $nodename, $release, $version, $machine) = POSIX::uname();</code></pre> <p>Note that the actual meanings of the various fields are not that well standardized, do not expect any great portability. The <code>$sysname</code> might be the name of the operating system, the <code>$nodename</code> might be the name of the host, the <code>$release</code> might be the (major) release number of the operating system, the <code>$version</code> might be the (minor) release number of the operating system, and the <code>$machine</code> might be a hardware identifier. Maybe.</p> </dd> <dt id="ungetc"><a class="permalink" href="#ungetc">#</a>ungetc</dt> <dd> <p>Use method <code>IO::Handle::ungetc()</code> instead.</p> </dd> <dt id="unlink"><a class="permalink" href="#unlink">#</a>unlink</dt> <dd> <p>This is identical to Perl's builtin <code>unlink()</code> function for removing files, see <a href="/5.6.1/perlfunc#unlink">"unlink" in perlfunc</a>.</p> </dd> <dt id="utime"><a class="permalink" href="#utime">#</a>utime</dt> <dd> <p>This is identical to Perl's builtin <code>utime()</code> function for changing the time stamps of files and directories, see <a href="/5.6.1/perlfunc#utime">"utime" in perlfunc</a>.</p> </dd> <dt id="vfprintf"><a class="permalink" href="#vfprintf">#</a>vfprintf</dt> <dd> <p>vfprintf() is C-specific, see <a href="/5.6.1/perlfunc#printf">"printf" in perlfunc</a> instead.</p> </dd> <dt id="vprintf"><a class="permalink" href="#vprintf">#</a>vprintf</dt> <dd> <p>vprintf() is C-specific, see <a href="/5.6.1/perlfunc#printf">"printf" in perlfunc</a> instead.</p> </dd> <dt id="vsprintf"><a class="permalink" href="#vsprintf">#</a>vsprintf</dt> <dd> <p>vsprintf() is C-specific, see <a href="/5.6.1/perlfunc#sprintf">"sprintf" in perlfunc</a> instead.</p> </dd> <dt id="wait"><a class="permalink" href="#wait">#</a>wait</dt> <dd> <p>This is identical to Perl's builtin <code>wait()</code> function, see <a href="/5.6.1/perlfunc#wait">"wait" in perlfunc</a>.</p> </dd> <dt id="waitpid"><a class="permalink" href="#waitpid">#</a>waitpid</dt> <dd> <p>Wait for a child process to change state. This is identical to Perl's builtin <code>waitpid()</code> function, see <a href="/5.6.1/perlfunc#waitpid">"waitpid" in perlfunc</a>.</p> <pre><code>$pid = POSIX::waitpid( -1, &POSIX::WNOHANG ); print "status = ", ($? / 256), "\n";</code></pre> </dd> <dt id="wcstombs"><a class="permalink" href="#wcstombs">#</a>wcstombs</dt> <dd> <p>This is identical to the C function <code>wcstombs()</code>. Perl does not have any support for the wide and multibyte characters of the C standards, so this might be a rather useless function.</p> </dd> <dt id="wctomb"><a class="permalink" href="#wctomb">#</a>wctomb</dt> <dd> <p>This is identical to the C function <code>wctomb()</code>. Perl does not have any support for the wide and multibyte characters of the C standards, so this might be a rather useless function.</p> </dd> <dt id="write"><a class="permalink" href="#write">#</a>write</dt> <dd> <p>Write to a file. This uses file descriptors such as those obtained by calling <code>POSIX::open</code>.</p> <pre><code>$fd = POSIX::open( "foo", &POSIX::O_WRONLY ); $buf = "hello"; $bytes = POSIX::write( $b, $buf, 5 );</code></pre> <p>Returns <code>undef</code> on failure.</p> <p>See also <a href="/5.6.1/perlfunc#syswrite">"syswrite" in perlfunc</a>.</p> </dd> </dl> <h1 id="CLASSES"><a class="permalink" href="#CLASSES">#</a>CLASSES</h1> <h2 id="POSIX::SigAction"><a class="permalink" href="#POSIX::SigAction">#</a><a id="POSIX"></a>POSIX::SigAction</h2> <dl> <dt id="new"><a class="permalink" href="#new">#</a>new</dt> <dd> <p>Creates a new <code>POSIX::SigAction</code> object which corresponds to the C <code>struct sigaction</code>. This object will be destroyed automatically when it is no longer needed. The first parameter is the fully-qualified name of a sub which is a signal-handler. The second parameter is a <code>POSIX::SigSet</code> object, it defaults to the empty set. The third parameter contains the <code>sa_flags</code>, it defaults to 0.</p> <pre><code>$sigset = POSIX::SigSet->new(SIGINT, SIGQUIT); $sigaction = POSIX::SigAction->new( 'main::handler', $sigset, &POSIX::SA_NOCLDSTOP );</code></pre> <p>This <code>POSIX::SigAction</code> object should be used with the <code>POSIX::sigaction()</code> function.</p> </dd> </dl> <h2 id="POSIX::SigSet"><a class="permalink" href="#POSIX::SigSet">#</a><a id="POSIX1"></a>POSIX::SigSet</h2> <dl> <dt id="new1"><a class="permalink" href="#new1">#</a>new</dt> <dd> <p>Create a new SigSet object. This object will be destroyed automatically when it is no longer needed. Arguments may be supplied to initialize the set.</p> <p>Create an empty set.</p> <pre><code>$sigset = POSIX::SigSet->new;</code></pre> <p>Create a set with SIGUSR1.</p> <pre><code>$sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );</code></pre> </dd> <dt id="addset"><a class="permalink" href="#addset">#</a>addset</dt> <dd> <p>Add a signal to a SigSet object.</p> <pre><code>$sigset->addset( &POSIX::SIGUSR2 );</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="delset"><a class="permalink" href="#delset">#</a>delset</dt> <dd> <p>Remove a signal from the SigSet object.</p> <pre><code>$sigset->delset( &POSIX::SIGUSR2 );</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="emptyset"><a class="permalink" href="#emptyset">#</a>emptyset</dt> <dd> <p>Initialize the SigSet object to be empty.</p> <pre><code>$sigset->emptyset();</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="fillset"><a class="permalink" href="#fillset">#</a>fillset</dt> <dd> <p>Initialize the SigSet object to include all signals.</p> <pre><code>$sigset->fillset();</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="ismember"><a class="permalink" href="#ismember">#</a>ismember</dt> <dd> <p>Tests the SigSet object to see if it contains a specific signal.</p> <pre><code>if( $sigset->ismember( &POSIX::SIGUSR1 ) ){ print "contains SIGUSR1\n"; }</code></pre> </dd> </dl> <h2 id="POSIX::Termios"><a class="permalink" href="#POSIX::Termios">#</a><a id="POSIX2"></a>POSIX::Termios</h2> <dl> <dt id="new2"><a class="permalink" href="#new2">#</a>new</dt> <dd> <p>Create a new Termios object. This object will be destroyed automatically when it is no longer needed. A Termios object corresponds to the termios C struct. new() mallocs a new one, getattr() fills it from a file descriptor, and setattr() sets a file descriptor's parameters to match Termios' contents.</p> <pre><code>$termios = POSIX::Termios->new;</code></pre> </dd> <dt id="getattr"><a class="permalink" href="#getattr">#</a>getattr</dt> <dd> <p>Get terminal control attributes.</p> <p>Obtain the attributes for stdin.</p> <pre><code>$termios->getattr()</code></pre> <p>Obtain the attributes for stdout.</p> <pre><code>$termios->getattr( 1 )</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="getcc"><a class="permalink" href="#getcc">#</a>getcc</dt> <dd> <p>Retrieve a value from the c_cc field of a termios object. The c_cc field is an array so an index must be specified.</p> <pre><code>$c_cc[1] = $termios->getcc(1);</code></pre> </dd> <dt id="getcflag"><a class="permalink" href="#getcflag">#</a>getcflag</dt> <dd> <p>Retrieve the c_cflag field of a termios object.</p> <pre><code>$c_cflag = $termios->getcflag;</code></pre> </dd> <dt id="getiflag"><a class="permalink" href="#getiflag">#</a>getiflag</dt> <dd> <p>Retrieve the c_iflag field of a termios object.</p> <pre><code>$c_iflag = $termios->getiflag;</code></pre> </dd> <dt id="getispeed"><a class="permalink" href="#getispeed">#</a>getispeed</dt> <dd> <p>Retrieve the input baud rate.</p> <pre><code>$ispeed = $termios->getispeed;</code></pre> </dd> <dt id="getlflag"><a class="permalink" href="#getlflag">#</a>getlflag</dt> <dd> <p>Retrieve the c_lflag field of a termios object.</p> <pre><code>$c_lflag = $termios->getlflag;</code></pre> </dd> <dt id="getoflag"><a class="permalink" href="#getoflag">#</a>getoflag</dt> <dd> <p>Retrieve the c_oflag field of a termios object.</p> <pre><code>$c_oflag = $termios->getoflag;</code></pre> </dd> <dt id="getospeed"><a class="permalink" href="#getospeed">#</a>getospeed</dt> <dd> <p>Retrieve the output baud rate.</p> <pre><code>$ospeed = $termios->getospeed;</code></pre> </dd> <dt id="setattr"><a class="permalink" href="#setattr">#</a>setattr</dt> <dd> <p>Set terminal control attributes.</p> <p>Set attributes immediately for stdout.</p> <pre><code>$termios->setattr( 1, &POSIX::TCSANOW );</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="setcc"><a class="permalink" href="#setcc">#</a>setcc</dt> <dd> <p>Set a value in the c_cc field of a termios object. The c_cc field is an array so an index must be specified.</p> <pre><code>$termios->setcc( &POSIX::VEOF, 1 );</code></pre> </dd> <dt id="setcflag"><a class="permalink" href="#setcflag">#</a>setcflag</dt> <dd> <p>Set the c_cflag field of a termios object.</p> <pre><code>$termios->setcflag( $c_cflag | &POSIX::CLOCAL );</code></pre> </dd> <dt id="setiflag"><a class="permalink" href="#setiflag">#</a>setiflag</dt> <dd> <p>Set the c_iflag field of a termios object.</p> <pre><code>$termios->setiflag( $c_iflag | &POSIX::BRKINT );</code></pre> </dd> <dt id="setispeed"><a class="permalink" href="#setispeed">#</a>setispeed</dt> <dd> <p>Set the input baud rate.</p> <pre><code>$termios->setispeed( &POSIX::B9600 );</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="setlflag"><a class="permalink" href="#setlflag">#</a>setlflag</dt> <dd> <p>Set the c_lflag field of a termios object.</p> <pre><code>$termios->setlflag( $c_lflag | &POSIX::ECHO );</code></pre> </dd> <dt id="setoflag"><a class="permalink" href="#setoflag">#</a>setoflag</dt> <dd> <p>Set the c_oflag field of a termios object.</p> <pre><code>$termios->setoflag( $c_oflag | &POSIX::OPOST );</code></pre> </dd> <dt id="setospeed"><a class="permalink" href="#setospeed">#</a>setospeed</dt> <dd> <p>Set the output baud rate.</p> <pre><code>$termios->setospeed( &POSIX::B9600 );</code></pre> <p>Returns <code>undef</code> on failure.</p> </dd> <dt id="Baud-rate-values"><a class="permalink" href="#Baud-rate-values">#</a><a id="Baud"></a>Baud rate values</dt> <dd> <p>B38400 B75 B200 B134 B300 B1800 B150 B0 B19200 B1200 B9600 B600 B4800 B50 B2400 B110</p> </dd> <dt id="Terminal-interface-values"><a class="permalink" href="#Terminal-interface-values">#</a><a id="Terminal"></a>Terminal interface values</dt> <dd> <p>TCSADRAIN TCSANOW TCOON TCIOFLUSH TCOFLUSH TCION TCIFLUSH TCSAFLUSH TCIOFF TCOOFF</p> </dd> <dt id="c_cc-field-values"><a class="permalink" href="#c_cc-field-values">#</a><a id="c_cc"></a>c_cc field values</dt> <dd> <p>VEOF VEOL VERASE VINTR VKILL VQUIT VSUSP VSTART VSTOP VMIN VTIME NCCS</p> </dd> <dt id="c_cflag-field-values"><a class="permalink" href="#c_cflag-field-values">#</a><a id="c_cflag"></a>c_cflag field values</dt> <dd> <p>CLOCAL CREAD CSIZE CS5 CS6 CS7 CS8 CSTOPB HUPCL PARENB PARODD</p> </dd> <dt id="c_iflag-field-values"><a class="permalink" href="#c_iflag-field-values">#</a><a id="c_iflag"></a>c_iflag field values</dt> <dd> <p>BRKINT ICRNL IGNBRK IGNCR IGNPAR INLCR INPCK ISTRIP IXOFF IXON PARMRK</p> </dd> <dt id="c_lflag-field-values"><a class="permalink" href="#c_lflag-field-values">#</a><a id="c_lflag"></a>c_lflag field values</dt> <dd> <p>ECHO ECHOE ECHOK ECHONL ICANON IEXTEN ISIG NOFLSH TOSTOP</p> </dd> <dt id="c_oflag-field-values"><a class="permalink" href="#c_oflag-field-values">#</a><a id="c_oflag"></a>c_oflag field values</dt> <dd> <p>OPOST</p> </dd> </dl> <h1 id="PATHNAME-CONSTANTS"><a class="permalink" href="#PATHNAME-CONSTANTS">#</a><a id="PATHNAME"></a>PATHNAME CONSTANTS</h1> <dl> <dt id="Constants"><a class="permalink" href="#Constants">#</a>Constants</dt> <dd> <p>_PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE</p> </dd> </dl> <h1 id="POSIX-CONSTANTS"><a class="permalink" href="#POSIX-CONSTANTS">#</a><a id="POSIX3"></a>POSIX CONSTANTS</h1> <dl> <dt id="Constants1"><a class="permalink" href="#Constants1">#</a>Constants</dt> <dd> <p>_POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED _POSIX_JOB_CONTROL _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_NO_TRUNC _POSIX_OPEN_MAX _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SAVED_IDS _POSIX_SSIZE_MAX _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VDISABLE _POSIX_VERSION</p> </dd> </dl> <h1 id="SYSTEM-CONFIGURATION"><a class="permalink" href="#SYSTEM-CONFIGURATION">#</a><a id="SYSTEM"></a>SYSTEM CONFIGURATION</h1> <dl> <dt id="Constants2"><a class="permalink" href="#Constants2">#</a>Constants</dt> <dd> <p>_SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION</p> </dd> </dl> <h1 id="ERRNO"><a class="permalink" href="#ERRNO">#</a>ERRNO</h1> <dl> <dt id="Constants3"><a class="permalink" href="#Constants3">#</a>Constants</dt> <dd> <p>E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF EBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE ERESTART EROFS ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV</p> </dd> </dl> <h1 id="FCNTL"><a class="permalink" href="#FCNTL">#</a>FCNTL</h1> <dl> <dt id="Constants4"><a class="permalink" href="#Constants4">#</a>Constants</dt> <dd> <p>FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_OK F_RDLCK F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC O_WRONLY</p> </dd> </dl> <h1 id="FLOAT"><a class="permalink" href="#FLOAT">#</a>FLOAT</h1> <dl> <dt id="Constants5"><a class="permalink" href="#Constants5">#</a>Constants</dt> <dd> <p>DBL_DIG DBL_EPSILON DBL_MANT_DIG DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP FLT_DIG FLT_EPSILON FLT_MANT_DIG FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX FLT_ROUNDS LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP</p> </dd> </dl> <h1 id="LIMITS"><a class="permalink" href="#LIMITS">#</a>LIMITS</h1> <dl> <dt id="Constants6"><a class="permalink" href="#Constants6">#</a>Constants</dt> <dd> <p>ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN SSIZE_MAX STREAM_MAX TZNAME_MAX UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX</p> </dd> </dl> <h1 id="LOCALE"><a class="permalink" href="#LOCALE">#</a>LOCALE</h1> <dl> <dt id="Constants7"><a class="permalink" href="#Constants7">#</a>Constants</dt> <dd> <p>LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME</p> </dd> </dl> <h1 id="MATH"><a class="permalink" href="#MATH">#</a>MATH</h1> <dl> <dt id="Constants8"><a class="permalink" href="#Constants8">#</a>Constants</dt> <dd> <p>HUGE_VAL</p> </dd> </dl> <h1 id="SIGNAL"><a class="permalink" href="#SIGNAL">#</a>SIGNAL</h1> <dl> <dt id="Constants9"><a class="permalink" href="#Constants9">#</a>Constants</dt> <dd> <p>SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND SA_RESTART SA_SIGINFO SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASK SIG_UNBLOCK</p> </dd> </dl> <h1 id="STAT"><a class="permalink" href="#STAT">#</a>STAT</h1> <dl> <dt id="Constants10"><a class="permalink" href="#Constants10">#</a>Constants</dt> <dd> <p>S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR</p> </dd> <dt id="Macros"><a class="permalink" href="#Macros">#</a>Macros</dt> <dd> <p>S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG</p> </dd> </dl> <h1 id="STDLIB"><a class="permalink" href="#STDLIB">#</a>STDLIB</h1> <dl> <dt id="Constants11"><a class="permalink" href="#Constants11">#</a>Constants</dt> <dd> <p>EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX RAND_MAX</p> </dd> </dl> <h1 id="STDIO"><a class="permalink" href="#STDIO">#</a>STDIO</h1> <dl> <dt id="Constants12"><a class="permalink" href="#Constants12">#</a>Constants</dt> <dd> <p>BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid L_tmpname TMP_MAX</p> </dd> </dl> <h1 id="TIME"><a class="permalink" href="#TIME">#</a>TIME</h1> <dl> <dt id="Constants13"><a class="permalink" href="#Constants13">#</a>Constants</dt> <dd> <p>CLK_TCK CLOCKS_PER_SEC</p> </dd> </dl> <h1 id="UNISTD"><a class="permalink" href="#UNISTD">#</a>UNISTD</h1> <dl> <dt id="Constants14"><a class="permalink" href="#Constants14">#</a>Constants</dt> <dd> <p>R_OK SEEK_CUR SEEK_END SEEK_SET STDIN_FILENO STDOUT_FILENO STDERR_FILENO W_OK X_OK</p> </dd> </dl> <h1 id="WAIT"><a class="permalink" href="#WAIT">#</a>WAIT</h1> <dl> <dt id="Constants15"><a class="permalink" href="#Constants15">#</a>Constants</dt> <dd> <p>WNOHANG WUNTRACED</p> </dd> <dt id="Macros1"><a class="permalink" href="#Macros1">#</a>Macros</dt> <dd> <p>WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG WIFSTOPPED WSTOPSIG</p> </dd> </dl> </div> <div id="footer"> <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p> <p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script> <script src="/js/highlight.pack.js"></script> <script>hljs.highlightAll();</script> </body> </html>