- Timeout parameter를 변경하지 않는다. 사용할 때마다 timeout을 다시 설정할 필요가 없음
- Signal parameter가 추가됨(sigmask) : signal 을 차단함.
Select() : 동기식 다중 입출력 제공
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
Int select (int n,
fd_set *readfds,
fd_set *writefds,
fd_set *execptfds,
struct timeval *timeout);
FD_CLR(int fd, fd_set *set); /* delete FD */
FD_ISSET(int fd, fd_set *set); /* select의 결과에 해당 fd가 있는지 */
FD_SET(int fd, fd_set *set); /* add FD*/
FD_ZERO(fd_set *set);
#include <sys/time.h>
Struct timeval {
long tv_sec; /* sec */
long tv_usec; /* micro sec */
};
Poll() : select를 보완 (fd set을 하나로 통일)
#include <sys/poll.h>
Int poll (struct pollfd *fds, unsigned int nfds, int timeout);
#include <sys/poll.h>
Struct pollfd {
int fd;
short events; /* 감시 대상 요청 */
short revents; /* returned event */
}
Events:
POLLIN : Data other than high-priority data may be read without blocking.
POLLRDNORM : Normal data may be read without blocking.
POLLRDBAND : Priority data may be read without blocking.
POLLPRI : High-priority data may be read without blocking.
POLLOUT : Normal data may be written without blocking.
POLLWRNORM : Equivalent to POLLOUT.
POLLWRBAND : Priority data may be written.
POLLERR : An error has occurred on the device or stream. This flag is only valid in the revents bitmask; it shall be ignored in the events member.
POLLHUP : The device has been disconnected. This event and POLLOUT are mutually-exclusive; a stream can never be writable if a hangup has occurred. However, this event and POLLIN, POLLRDNORM, POLLRDBAND, or POLLPRI are not mutually-exclusive. This flag is only valid in the revents bitmask; it shall be ignored in the events member.
POLLNVAL : The specified fd value is invalid. This flag is only valid in the revents member; it shall ignored in the events member.
Ppoll() : pselect 처럼 만든 것, 나노초 단위, sigmask 제공, linux 전용
#define _GNU_SOURCE
#include <sys/poll.h>
Int ppoll (struct pollfd *fds,
nfds_t nfds,
const struct timespec *timeout,
const sigset_t *sigmask);
Poll과 select 비교
oll
select
매개변수에
+1(fd+1)이 필요없다
fd의
숫자가 큰 경우 select보다 효율적
fd_set값이
크면 비효율적이다. bitmask를 모두 검사하며 특히 bit가 분산된 경우 더욱 비효율적이다
매번
set을 초기화해야 한다.(FD_ZERO)
이식성을
높이기 위해 timeout parameter(timeval)를 매번 초기화 해야함
On Nexus 10, after unlocking the bootloader, the internal storage is
left unformatted and must be formatted with
$ fastboot format cache $ fastboot format userdata
Cleaning up when adding proprietary binaries
In order to make sure that the newly installed binaries are properly
taken into account after being extracted, the existing output of any previous
build needs to be deleted with
Can't locate Switch.pm in @INC (you may need to install the Switch
module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2
/usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5
/usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at
external/webkit/Source/WebCore/make-hash-tools.pl line 23.
BEGIN failed--compilation aborted at
external/webkit/Source/WebCore/make-hash-tools.pl line 23.
make: * [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/html/DocTypeStrings.cpp] Error 2
Solve
$sudo apt-get install libswitch-perl
I have solve this, actually i was using 14.04LTS for android 4.2jellybean source code.
In 14.04LTS have to install the switch module. Below is the procedure to install
1:use below command and configure as automatic
$cpan App::cpanminus
2:install switch
$cpanm Switch
Note:By using these two commands that problem solved in my Ubuntu 14.04LTS....
prebuilts/tools/gcc-sdk/gcc: line 40: prebuilts/tools/gcc-sdk/../../gcc/linux-x86/host/i686-linux-glibc2.7-4.6/bin/i686-linux-gcc: No such file or directory