⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 posix.pod

📁 UNIX下perl实现代码
💻 POD
📖 第 1 页 / 共 4 页
字号:
operating system, and the C<$machine> might be a hardware identifier.Maybe.=item ungetcUse method C<IO::Handle::ungetc()> instead.=item unlinkThis is identical to Perl's builtin C<unlink()> functionfor removing files, see L<perlfunc/unlink>.=item utimeThis is identical to Perl's builtin C<utime()> functionfor changing the time stamps of files and directories,see L<perlfunc/utime>.=item vfprintfvfprintf() is C-specific, see L<perlfunc/printf> instead.=item vprintfvprintf() is C-specific, see L<perlfunc/printf> instead.=item vsprintfvsprintf() is C-specific, see L<perlfunc/sprintf> instead.=item waitThis is identical to Perl's builtin C<wait()> function,see L<perlfunc/wait>.=item waitpidWait for a child process to change state.  This is identical to Perl'sbuiltin C<waitpid()> function, see L<perlfunc/waitpid>.	$pid = POSIX::waitpid( -1, &POSIX::WNOHANG );	print "status = ", ($? / 256), "\n";=item wcstombsThis is identical to the C function C<wcstombs()>.Perl does not have any support for the wide and multibytecharacters of the C standards, so this might be a rather useless function.=item wctombThis is identical to the C function C<wctomb()>.Perl does not have any support for the wide and multibytecharacters of the C standards, so this might be a rather useless function.=item writeWrite to a file.  This uses file descriptors such as those obtained bycalling C<POSIX::open>.	$fd = POSIX::open( "foo", &POSIX::O_WRONLY );	$buf = "hello";	$bytes = POSIX::write( $b, $buf, 5 );Returns C<undef> on failure.See also L<perlfunc/syswrite>.=back=head1 CLASSES=head2 POSIX::SigAction=over 8=item newCreates a new C<POSIX::SigAction> object which corresponds to the CC<struct sigaction>.  This object will be destroyed automatically when it isno longer needed.  The first parameter is the fully-qualified name of a subwhich is a signal-handler.  The second parameter is a C<POSIX::SigSet>object, it defaults to the empty set.  The third parameter contains theC<sa_flags>, it defaults to 0.	$sigset = POSIX::SigSet->new(SIGINT, SIGQUIT);	$sigaction = POSIX::SigAction->new( 'main::handler', $sigset, &POSIX::SA_NOCLDSTOP );This C<POSIX::SigAction> object should be used with the C<POSIX::sigaction()>function.=back=head2 POSIX::SigSet=over 8=item newCreate a new SigSet object.  This object will be destroyed automaticallywhen it is no longer needed.  Arguments may be supplied to initialize theset.Create an empty set.	$sigset = POSIX::SigSet->new;Create a set with SIGUSR1.	$sigset = POSIX::SigSet->new( &POSIX::SIGUSR1 );=item addsetAdd a signal to a SigSet object.	$sigset->addset( &POSIX::SIGUSR2 );Returns C<undef> on failure.=item delsetRemove a signal from the SigSet object.	$sigset->delset( &POSIX::SIGUSR2 );Returns C<undef> on failure.=item emptysetInitialize the SigSet object to be empty.	$sigset->emptyset();Returns C<undef> on failure.=item fillsetInitialize the SigSet object to include all signals.	$sigset->fillset();Returns C<undef> on failure.=item ismemberTests the SigSet object to see if it contains a specific signal.	if( $sigset->ismember( &POSIX::SIGUSR1 ) ){		print "contains SIGUSR1\n";	}=back=head2 POSIX::Termios=over 8=item newCreate a new Termios object.  This object will be destroyed automaticallywhen it is no longer needed.  A Termios object corresponds to the termiosC 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.	$termios = POSIX::Termios->new;=item getattrGet terminal control attributes.Obtain the attributes for stdin.	$termios->getattr()Obtain the attributes for stdout.	$termios->getattr( 1 )Returns C<undef> on failure.=item getccRetrieve a value from the c_cc field of a termios object.  The c_cc field isan array so an index must be specified.	$c_cc[1] = $termios->getcc(1);=item getcflagRetrieve the c_cflag field of a termios object.	$c_cflag = $termios->getcflag;=item getiflagRetrieve the c_iflag field of a termios object.	$c_iflag = $termios->getiflag;=item getispeedRetrieve the input baud rate.	$ispeed = $termios->getispeed;=item getlflagRetrieve the c_lflag field of a termios object.	$c_lflag = $termios->getlflag;=item getoflagRetrieve the c_oflag field of a termios object.	$c_oflag = $termios->getoflag;=item getospeedRetrieve the output baud rate.	$ospeed = $termios->getospeed;=item setattrSet terminal control attributes.Set attributes immediately for stdout.	$termios->setattr( 1, &POSIX::TCSANOW );Returns C<undef> on failure.=item setccSet a value in the c_cc field of a termios object.  The c_cc field is anarray so an index must be specified.	$termios->setcc( &POSIX::VEOF, 1 );=item setcflagSet the c_cflag field of a termios object.	$termios->setcflag( $c_cflag | &POSIX::CLOCAL );=item setiflagSet the c_iflag field of a termios object.	$termios->setiflag( $c_iflag | &POSIX::BRKINT );=item setispeedSet the input baud rate.	$termios->setispeed( &POSIX::B9600 );Returns C<undef> on failure.=item setlflagSet the c_lflag field of a termios object.	$termios->setlflag( $c_lflag | &POSIX::ECHO );=item setoflagSet the c_oflag field of a termios object.	$termios->setoflag( $c_oflag | &POSIX::OPOST );=item setospeedSet the output baud rate.	$termios->setospeed( &POSIX::B9600 );Returns C<undef> on failure.=item Baud rate valuesB38400 B75 B200 B134 B300 B1800 B150 B0 B19200 B1200 B9600 B600 B4800 B50 B2400 B110=item Terminal interface valuesTCSADRAIN TCSANOW TCOON TCIOFLUSH TCOFLUSH TCION TCIFLUSH TCSAFLUSH TCIOFF TCOOFF=item c_cc field valuesVEOF VEOL VERASE VINTR VKILL VQUIT VSUSP VSTART VSTOP VMIN VTIME NCCS=item c_cflag field valuesCLOCAL CREAD CSIZE CS5 CS6 CS7 CS8 CSTOPB HUPCL PARENB PARODD=item c_iflag field valuesBRKINT ICRNL IGNBRK IGNCR IGNPAR INLCR INPCK ISTRIP IXOFF IXON PARMRK=item c_lflag field valuesECHO ECHOE ECHOK ECHONL ICANON IEXTEN ISIG NOFLSH TOSTOP=item c_oflag field valuesOPOST=back=head1 PATHNAME CONSTANTS=over 8=item Constants_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=back=head1 POSIX CONSTANTS=over 8=item Constants_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=back=head1 SYSTEM CONFIGURATION=over 8=item Constants_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=back=head1 ERRNO=over 8=item ConstantsE2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADFEBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQEDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS EINTREINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE ENAMETOOLONGENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODEV ENOENT ENOEXECENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIRENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPEEPROCLIM EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE ERESTART EROFSESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFSETXTBSY EUSERS EWOULDBLOCK EXDEV=back=head1 FCNTL=over 8=item ConstantsFD_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=back=head1 FLOAT=over 8=item ConstantsDBL_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=back=head1 LIMITS=over 8=item ConstantsARG_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=back=head1 LOCALE=over 8=item ConstantsLC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME=back=head1 MATH=over 8=item ConstantsHUGE_VAL=back=head1 SIGNAL=over 8=item ConstantsSA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND SA_RESTARTSA_SIGINFO SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINTSIGKILL SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOUSIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASKSIG_UNBLOCK=back=head1 STAT=over 8=item ConstantsS_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=item MacrosS_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG=back=head1 STDLIB=over 8=item ConstantsEXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX RAND_MAX=back=head1 STDIO=over 8=item ConstantsBUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid L_tmpname TMP_MAX=back=head1 TIME=over 8=item ConstantsCLK_TCK CLOCKS_PER_SEC=back=head1 UNISTD=over 8=item ConstantsR_OK SEEK_CUR SEEK_END SEEK_SET STDIN_FILENO STDOUT_FILENO STDERR_FILENO W_OK X_OK=back=head1 WAIT=over 8=item ConstantsWNOHANG WUNTRACED=item MacrosWIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG WIFSTOPPED WSTOPSIG=back

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -