PageRenderTime 1149ms queryTime 40ms sortTime 1ms getByIdsTime 307ms findMatchingLines 145ms

100+ results results for 'MSG_PEEK' (1149 ms)

Not the results you expected?
datagram.c https://github.com/xoox/linux-2.6.18_pro500.git | C | 535 lines
                    
167		 */
                    
168		if (flags & MSG_PEEK) {
                    
169			unsigned long cpu_flags;
                    
212 *
                    
213 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
214 *	receive queue of the socket, it will be taken off the queue
                    
223{
                    
224	if (flags & MSG_PEEK) {
                    
225		spin_lock_bh(&sk->sk_receive_queue.lock);
                    
                
ospf6_network.c https://github.com/labx-technologies-llc/mb-linux-labx.git | C | 501 lines
                    
458void
                    
459ospf6_recvmsg_peek (struct in6_addr *src, struct in6_addr *dst,
                    
460                    unsigned int *ifindex, struct iovec *message)
                    
486
                    
487  retval = recvmsg (ospf6_sock, &rmsghdr, MSG_PEEK);
                    
488  if (retval != iov_totallen (message))
                    
                
sock.c https://github.com/hackndev/linux-hnd.git | C | 388 lines
                    
112
                    
113	result = _recvfrom(socket, header, 4, MSG_PEEK);
                    
114	if (result == -EAGAIN)
                    
                
toc-bert_rpr.rpc-module.html https://github.com/DwayneDibley/BERT-RPR.git | HTML | 155 lines
                    
88     >MSG_DONTROUTE</a><br />    <a target="mainFrame" href="bert_rpr.rpc-module.html#MSG_OOB"
                    
89     >MSG_OOB</a><br />    <a target="mainFrame" href="bert_rpr.rpc-module.html#MSG_PEEK"
                    
90     >MSG_PEEK</a><br />    <a target="mainFrame" href="bert_rpr.rpc-module.html#MSG_TRUNC"
                    
                
sockets.h https://github.com/meriac/openbeacon.git | C Header | 346 lines
                    
134/* Flags we can use with send and recv. */
                    
135#define MSG_PEEK       0x01	/* Peeks at an incoming message */
                    
136#define MSG_WAITALL    0x02	/* Unimplemented: Requests that the function block until the full amount of data requested can be returned */
                    
                
AsyncFile.py git://pkgs.fedoraproject.org/eric | Python | 293 lines
                    
178        # read a line at a time.
                    
179        line = self.sock.recv(size, socket.MSG_PEEK)
                    
180
                    
                
ipv4-header-test.cc https://gitlab.com/msepahkar/location_in_wireless_ndn | C++ | 266 lines
                    
104  availableData = socket->GetRxAvailable ();
                    
105  m_receivedPacket = socket->Recv (2, MSG_PEEK);
                    
106  NS_ASSERT (m_receivedPacket->GetSize () == 2);
                    
                
kernel_netlink_shared.c git://pkgs.fedoraproject.org/strongswan | C | 307 lines
                    
163		 * numbers to detect multi header messages */
                    
164		len = recvfrom(this->socket, &peek, sizeof(peek), MSG_PEEK | MSG_DONTWAIT,
                    
165					   (struct sockaddr*)&addr, &addr_len);
                    
                
vchi.h https://gitlab.com/kush/linux | C Header | 238 lines
                    
132// will return the same message.
                    
133extern int32_t vchi_msg_peek(VCHI_SERVICE_HANDLE_T handle,
                    
134			     void **data,
                    
                
syscall_windows.go https://gitlab.com/4144/gcc | Go | 307 lines
                    
129
                    
130	MSG_PEEK   = 0x2
                    
131	MSG_TRUNC  = 0x0100
                    
                
IN.py https://bitbucket.org/__wp__/mb-linux-msli.git | Python | 430 lines
                    
145MSG_OOB = 1
                    
146MSG_PEEK = 2
                    
147MSG_DONTROUTE = 4
                    
                
PlainDatagramSocketImpl.java https://bitbucket.org/aways/android_libcore.git | Java | 240 lines
                    
173    public int peekData(DatagramPacket pack) throws IOException {
                    
174        doRecv(pack, MSG_PEEK);
                    
175        return pack.getPort();
                    
                
socket_base.hpp https://gitlab.com/cdeclare/intcrypt | C++ Header | 522 lines
                    
69  BOOST_ASIO_STATIC_CONSTANT(int,
                    
70      message_peek = BOOST_ASIO_OS_DEF(MSG_PEEK));
                    
71  BOOST_ASIO_STATIC_CONSTANT(int,
                    
                
os_socket.h https://github.com/origins/CactusEMU.git | C Header | 307 lines
                    
154
                    
155#if !defined (MSG_PEEK)
                    
156#  define MSG_PEEK 0x2
                    
156#  define MSG_PEEK 0x2
                    
157#endif /* MSG_PEEK */
                    
158
                    
                
main.c https://gitlab.com/o1s2/selflrrn | C | 438 lines
                    
41int		mcastttl;			/* multicast TTL */
                    
42int		msgpeek;			/* MSG_PEEK */
                    
43int		nodelay;			/* TCP_NODELAY (Nagle algorithm) */
                    
293
                    
294		case 'Z':			/* MSG_PEEK option */
                    
295			msgpeek = MSG_PEEK;
                    
428"         -Y    SO_DONTROUTE option\n"
                    
429"         -Z    MSG_PEEK\n"
                    
430#ifdef	IP_ONESBCAST
                    
                
socket_types.hpp https://github.com/ratboy2499/evemu_incursion.git | C++ Header | 176 lines
                    
111const int shutdown_both = SD_BOTH;
                    
112const int message_peek = MSG_PEEK;
                    
113const int message_out_of_band = MSG_OOB;
                    
155const int shutdown_both = SHUT_RDWR;
                    
156const int message_peek = MSG_PEEK;
                    
157const int message_out_of_band = MSG_OOB;
                    
                
sfpkrd.c https://github.com/richlowe/illumos-gate.git | C | 291 lines
                    
207			/*
                    
208			 * work around macos 10.4 recv(MSG_PEEK) bug that consumes pipe() data
                    
209			 */
                    
218				tst[1] = 'z';
                    
219				recv_peek_ok = (!pipe(fds) && write(fds[1], tst, 2) && recv(fds[0], tst, 1, MSG_PEEK) == 1 && tst[0] == 'a' && recv(fds[0], tst, 1, MSG_PEEK) == 1 && tst[0] == 'a') ? 1 : -1;
                    
220				close(fds[0]);
                    
229#endif
                    
230			while((r = recv(fd,(char*)buf,n,MSG_PEEK)) < 0)
                    
231			{	if(errno == EINTR)
                    
                
TCP.cpp https://gitlab.com/piconf/software.git | C++ | 308 lines
                    
104void VIO::TCP::read() {
                    
105	int bytes = recv(fd, destinations.front().data, destinations.front().left, destinations.front().size ? 0 : MSG_PEEK);
                    
106	if (0 > bytes)
                    
                
vsock_test.c https://github.com/penberg/linux.git | C | 456 lines
                    
252
                    
253static void test_stream_msg_peek_client(const struct test_opts *opts)
                    
254{
                    
266
                    
267static void test_stream_msg_peek_server(const struct test_opts *opts)
                    
268{
                    
276
                    
277	recv_byte(fd, 1, MSG_PEEK);
                    
278	recv_byte(fd, 1, 0);
                    
307	{
                    
308		.name = "SOCK_STREAM MSG_PEEK",
                    
309		.run_client = test_stream_msg_peek_client,
                    
309		.run_client = test_stream_msg_peek_client,
                    
310		.run_server = test_stream_msg_peek_server,
                    
311	},
                    
                
mod_jaxer_message.h https://github.com/absynce/Jaxer.git | C Header | 150 lines
                    
105	 */
                    
106    int jxr_msg_peek_int16(unsigned char* buf, apr_size_t pos);
                    
107
                    
108    char jxr_msg_get_byte(unsigned char* buf, apr_size_t *pos);  
                    
109    char jxr_msg_peek_byte(unsigned char* buf, apr_size_t *pos);
                    
110
                    
                
socket.h https://github.com/CyanogenMod/android_bionic.git | C Header | 332 lines
                    
216#define MSG_OOB 1
                    
217#define MSG_PEEK 2
                    
218#define MSG_DONTROUTE 4
                    
                
test-pfkey.c https://bitbucket.org/freebsd/freebsd-base.git | C | 533 lines
                    
96{
                    
97	u_char rbuf[1024 * 32];	/* XXX: Enough ? Should I do MSG_PEEK ? */
                    
98	int so, len;
                    
                
recvfrom_spec.rb https://github.com/rklemme/ruby.git | Ruby | 98 lines
                    
34    it "uses different message options" do
                    
35      @client.send("foobar", Socket::MSG_PEEK)
                    
36      sock = @server.accept
                    
36      sock = @server.accept
                    
37      peek_data = sock.recvfrom(6, Socket::MSG_PEEK) # Does not retrieve the message
                    
38      real_data = sock.recvfrom(6)
                    
                
application_manager.rb https://gitlab.com/gitnyasha/zimcreative | Ruby | 140 lines
                    
124          IO.select([child])
                    
125          break if child.recv(1, Socket::MSG_PEEK).empty?
                    
126          sleep 0.01
                    
                
socket.d https://github.com/SiegeLord/Tango-D2.git | D | 498 lines
                    
95MSG_OOB
                    
96MSG_PEEK
                    
97MSG_TRUNC
                    
                
socket.php https://github.com/philbrookes/Game.git | PHP | 99 lines
                    
81	public function isAlive(){
                    
82	    $res = @socket_recv($this->sockHandle, $data, 1024, MSG_PEEK);
                    
83	    $result = socket_last_error($this->sockHandle);
                    
                
SSL_SOCK_Stream.cpp https://github.com/chucho/FaceCore.git | C++ | 626 lines
                    
390    {
                    
391      if ((flags | MSG_PEEK) != MSG_PEEK)
                    
392        {
                    
439    {
                    
440      if ((flags | MSG_PEEK) != MSG_PEEK)
                    
441        {
                    
                
socket.c https://github.com/Mengqi/linux-2.6.git | C | 840 lines
                    
160	if (len < copied) {
                    
161		if (flags & MSG_PEEK)
                    
162			atomic_dec(&skb->users);
                    
                
datagram.c https://github.com/mstsirkin/kvm.git | C | 775 lines
                    
187			*peeked = skb->peeked;
                    
188			if (flags & MSG_PEEK) {
                    
189				skb->peeked = 1;
                    
260 *
                    
261 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
262 *	receive queue of the socket, it will be taken off the queue
                    
275
                    
276	if (flags & MSG_PEEK) {
                    
277		err = -ENOENT;
                    
                
java_net_PlainDatagramSocketImpl.c https://github.com/cscott/Harpoon.git | C | 428 lines
                    
261  do {
                    
262    rc = recvfrom(fd, buf, 0, MSG_PEEK, (struct sockaddr *) &sa, &salen);
                    
263  } while (rc<0 && errno==EINTR); /* repeat if interrupted */
                    
                
owsl_tcp.c https://github.com/VoxOx/VoxOx.git | C | 330 lines
                    
66	/* get packet and packet size */
                    
67	received_bytes = recv (socket->system_socket, buffer, OWSL_TCP_BUFFER_SIZE, MSG_PEEK) ;
                    
68	if (received_bytes > 0)
                    
                
poll.c https://gitlab.com/nmusco/git | C | 614 lines
                    
71
                    
72/* BeOS does not have MSG_PEEK.  */
                    
73#ifndef MSG_PEEK
                    
73#ifndef MSG_PEEK
                    
74# define MSG_PEEK 0
                    
75#endif
                    
244      WSASetLastError (0);
                    
245      r = recv (h, data, sizeof (data), MSG_PEEK);
                    
246      error = WSAGetLastError ();
                    
282# if defined __MACH__ && defined __APPLE__
                    
283      /* There is a bug in Mac OS X that causes it to ignore MSG_PEEK
                    
284	 for some kinds of descriptors.  Detect if this descriptor is a
                    
286	 0-byte recv, and use ioctl(2) to detect POLLHUP.  */
                    
287      r = recv (fd, NULL, 0, MSG_PEEK);
                    
288      socket_errno = (r < 0) ? errno : 0;
                    
                
RubySocket.java https://gitlab.com/essere.lab.public/qualitas.class-corpus | Java | 605 lines
                    
96        rb_mConstants.setConstant("MSG_OOB", runtime.newFixnum(MSG_OOB));
                    
97        rb_mConstants.setConstant("MSG_PEEK", runtime.newFixnum(MSG_PEEK));
                    
98        rb_mConstants.setConstant("MSG_DONTROUTE", runtime.newFixnum(MSG_DONTROUTE));
                    
                
ngx_http_ajp_msg.c https://github.com/yaoweibin/nginx_ajp_module.git | C | 482 lines
                    
244ngx_int_t
                    
245ajp_msg_peek_uint16(ajp_msg_t *msg, uint16_t *rvalue)
                    
246{
                    
252    if ((buf->pos + 2) > buf->last) {
                    
253        return ajp_log_overflow(msg, "ajp_msg_peek_uint16");
                    
254    }
                    
265ngx_int_t
                    
266ajp_msg_peek_uint8(ajp_msg_t *msg, u_char *rvalue)
                    
267{
                    
268    if ((msg->buf->pos + 1) > msg->buf->last) {
                    
269        return ajp_log_overflow(msg, "ajp_msg_peek_uint8");
                    
270    }
                    
                
svcsock.c https://bitbucket.org/abdulhadif/android_kernel_samsung_espresso10.git | C | 1663 lines
                    
576	err = kernel_recvmsg(svsk->sk_sock, &msg, NULL,
                    
577			     0, 0, MSG_PEEK | MSG_DONTWAIT);
                    
578	if 
                    
                
datagram.c https://bitbucket.org/codefirex/kernel_samsung_jf.git | C | 780 lines
                    
188			*peeked = skb->peeked;
                    
189			if (flags & MSG_PEEK) {
                    
190				if (*off >= skb->len) {
                    
265 *
                    
266 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
267 *	receive queue of the socket, it will be taken off the queue
                    
280
                    
281	if (flags & MSG_PEEK) {
                    
282		err = -ENOENT;
                    
                
vqp.c https://github.com/artisdom/freeradius-server.git | C | 691 lines
                    
159	 */
                    
160	data_len = recvfrom(sockfd, header, sizeof(header), MSG_PEEK,
                    
161			    (struct sockaddr *)&src, &sizeof_src);
                    
                
mptcp_connect.c https://github.com/kvaneesh/linux.git | C | 1107 lines
                    
93	fprintf(stderr,
                    
94		"\t-P [saveWithPeek|saveAfterPeek] -- save data with/after MSG_PEEK form tcp socket\n");
                    
95	exit(1);
                    
426	if (cfg_peek == CFG_WITH_PEEK) {
                    
427		ret = recv(fd, buf, cap, MSG_PEEK);
                    
428		ret = (ret < 0) ? ret : read(fd, tmp, ret);
                    
429	} else if (cfg_peek == CFG_AFTER_PEEK) {
                    
430		ret = recv(fd, buf, cap, MSG_PEEK);
                    
431		ret = (ret < 0) ? ret : read(fd, buf, cap);
                    
                
test_sockmap.c https://github.com/kvaneesh/linux.git | C | 2026 lines
                    
554{
                    
555	struct msghdr msg = {0}, msg_peek = {0};
                    
556	int err, i, flags = MSG_NOSIGNAL;
                    
563	if (peek_flag) {
                    
564		err = msg_alloc_iov(&msg_peek, iov_count, iov_length, data, tx);
                    
565		if (err)
                    
645			if (peek_flag) {
                    
646				flags |= MSG_PEEK;
                    
647				recvp = recvmsg(fd, &msg_peek, flags);
                    
                
skmsg.c https://github.com/kvaneesh/linux.git | C | 1183 lines
                    
406	struct iov_iter *iter = &msg->msg_iter;
                    
407	int peek = flags & MSG_PEEK;
                    
408	struct sk_msg *msg_rx;
                    
                
datagram.c https://github.com/kvaneesh/linux.git | C | 837 lines
                    
176
                    
177	if (unlikely(flags & MSG_PEEK && *off >= 0)) {
                    
178		peek_at_off = true;
                    
183	skb_queue_walk(queue, skb) {
                    
184		if (flags & MSG_PEEK) {
                    
185			if (peek_at_off && _off >= skb->len &&
                    
356
                    
357	if (flags & MSG_PEEK) {
                    
358		err = -ENOENT;
                    
384 *
                    
385 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
386 *	receive queue of the socket, it will be taken off the queue
                    
                
socket.c https://github.com/kvaneesh/linux.git | C | 825 lines
                    
147	if (len < copied) {
                    
148		if (flags & MSG_PEEK)
                    
149			refcount_dec(&skb->users);
                    
                
libnetlink.c https://gitlab.com/brian0218/rk3066_r-box_android4.2.2_sdk | C | 682 lines
                    
125	/* Check for immediate errors */
                    
126	status = recv(rth->fd, resp, sizeof(resp), MSG_DONTWAIT|MSG_PEEK);
                    
127	if (status < 0) {
                    
                
netlink-types.h https://gitlab.com/brian0218/rk3188_r-box_android4.2.2_sdk | C Header | 832 lines
                    
26#define NL_OWN_PORT		(1<<2)
                    
27#define NL_MSG_PEEK		(1<<3)
                    
28#define NL_NO_AUTO_ACK		(1<<4)
                    
                
privsep.c https://gitlab.com/brian0218/rk3188_r-box_android4.2.2_sdk | C | 1339 lines
                    
115	while ((len = recvfrom(sock, (char *)&com, 
                    
116	    sizeof(com), MSG_PEEK, NULL, NULL)) == -1) {
                    
117		if (errno == EINTR)
                    
                
sock.h https://gitlab.com/lely_industries/io | C Header | 697 lines
                    
52	//! Peeks at incoming data.
                    
53	IO_MSG_PEEK = 1 << 0,
                    
54	//! Requests out-of-band data.
                    
112 *               source address.
                    
113 * \param flags  the type of message reception (any combination of #IO_MSG_PEEK,
                    
114 *               #IO_MSG_OOB and #IO_MSG_WAITALL).
                    
                
svcsock.c https://bitbucket.org/Lloir/lge-kernel-jb.git | C | 1615 lines
                    
548	err = kernel_recvmsg(svsk->sk_sock, &msg, NULL,
                    
549			     0, 0, MSG_PEEK | MSG_DONTWAIT);
                    
550	if (err >= 0)
                    
                
sock_symbian.cpp https://bitbucket.org/bohlooli/csipsimple2.git | C++ | 1021 lines
                    
83const int PJ_MSG_OOB	     = 0;
                    
84const int PJ_MSG_PEEK	     = KSockReadPeek;
                    
85const int PJ_MSG_DONTROUTE   = 0;
                    
                
sock_bsd.c https://bitbucket.org/bohlooli/csipsimple2.git | C | 849 lines
                    
166const int PJ_MSG_OOB		= MSG_OOB;
                    
167const int PJ_MSG_PEEK		= MSG_PEEK;
                    
168const int PJ_MSG_DONTROUTE	= MSG_DONTROUTE;
                    
                
pjlibU.def https://bitbucket.org/bohlooli/csipsimple2.git | Module-Definition | 326 lines
                    
23	pj_MSG_OOB                               @ 22 NONAME
                    
24	pj_MSG_PEEK                              @ 23 NONAME
                    
25	pj_NO_MEMORY_EXCEPTION                   @ 24 NONAME
                    
                
recvmsg.c https://github.com/gby/linux.git | C | 705 lines
                    
118
                    
119	if (ret == 0 && !(flags & MSG_PEEK)) {
                    
120		_debug("to be accepted");
                    
339
                    
340		if (!(flags & MSG_PEEK))
                    
341			trace_rxrpc_receive(call, rxrpc_receive_front,
                    
390		last = sp->hdr.flags & RXRPC_LAST_PACKET;
                    
391		if (!(flags & MSG_PEEK))
                    
392			rxrpc_rotate_rx_window(call);
                    
405out:
                    
406	if (!(flags & MSG_PEEK)) {
                    
407		call->rx_pkt_offset = rx_pkt_offset;
                    
483	call = list_entry(l, struct rxrpc_call, recvmsg_link);
                    
484	if (!(flags & MSG_PEEK))
                    
485		list_del_init(&call->recvmsg_link);
                    
                
vchiq_shim.c https://github.com/gby/linux.git | C | 858 lines
                    
80/***********************************************************
                    
81 * Name: vchi_msg_peek
                    
82 *
                    
96 ***********************************************************/
                    
97int32_t vchi_msg_peek(VCHI_SERVICE_HANDLE_T handle,
                    
98	void **data,
                    
118}
                    
119EXPORT_SYMBOL(vchi_msg_peek);
                    
120
                    
126 * Description: Routine to remove a message (after it has been read with
                    
127 *              vchi_msg_peek)
                    
128 *
                    
                
ajp_msg.c https://bitbucket.org/jonasteuwen/apache2nginx.git | C | 607 lines
                    
382 */
                    
383apr_status_t ajp_msg_peek_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue)
                    
384{
                    
387    if ((msg->pos + 1) > msg->len) {
                    
388        return ajp_log_overflow(msg, "ajp_msg_peek_uint16");
                    
389    }
                    
405 */
                    
406apr_status_t ajp_msg_peek_uint8(ajp_msg_t *msg, apr_byte_t *rvalue)
                    
407{
                    
408    if (msg->pos > msg->len) {
                    
409        return ajp_log_overflow(msg, "ajp_msg_peek_uint8");
                    
410    }
                    
                
ajp.h https://bitbucket.org/jonasteuwen/apache2nginx.git | C Header | 509 lines
                    
296 */
                    
297apr_status_t ajp_msg_peek_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue);
                    
298
                    
315 */
                    
316apr_status_t ajp_msg_peek_uint8(ajp_msg_t *msg, apr_byte_t *rvalue);
                    
317
                    
                
datagram.c https://bitbucket.org/danhamilt1/linux.git | C | 787 lines
                    
192			*peeked = skb->peeked;
                    
193			if (flags & MSG_PEEK) {
                    
194				if (_off >= skb->len && (skb->len || _off ||
                    
270 *
                    
271 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
272 *	receive queue of the socket, it will be taken off the queue
                    
285
                    
286	if (flags & MSG_PEEK) {
                    
287		err = -ENOENT;
                    
                
socket.h https://gitlab.com/gl-xinshouyong/1407-mifi-customer-tmp | C Header | 221 lines
                    
24#define NL_OWN_PORT		(1<<2)
                    
25#define NL_MSG_PEEK		(1<<3)
                    
26#define NL_NO_AUTO_ACK		(1<<4)
                    
151/**
                    
152 * Enable use of MSG_PEEK when reading from socket
                    
153 * @arg sk		Netlink socket.
                    
154 */
                    
155static inline void nl_socket_enable_msg_peek(struct nl_sock *sk)
                    
156{
                    
156{
                    
157	sk->s_flags |= NL_MSG_PEEK;
                    
158}
                    
160/**
                    
161 * Disable use of MSG_PEEK when reading from socket
                    
162 * @arg sk		Netlink socket.
                    
                
datagram.c https://github.com/iksaif/platform-drivers-x86.git | C | 779 lines
                    
188			*peeked = skb->peeked;
                    
189			if (flags & MSG_PEEK) {
                    
190				if (*off >= skb->len && skb->len) {
                    
264 *
                    
265 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
266 *	receive queue of the socket, it will be taken off the queue
                    
279
                    
280	if (flags & MSG_PEEK) {
                    
281		err = -ENOENT;
                    
                
gnutls_buffers.c https://github.com/MaDDoGo/xbmc.git | C | 1111 lines
                    
297/* This function is only used with berkeley style sockets.
                    
298 * Clears the peeked data (read with MSG_PEEK).
                    
299 */
                    
315
                    
316  /* this was already read by using MSG_PEEK - so it shouldn't fail */
                    
317  sum = 0;
                    
346
                    
347/* This function is like recv(with MSG_PEEK). But it does not return -1 on error.
                    
348 * It does return MHD_gnutls_errno instead.
                    
469  /* This is a hack placed in order for select to work. Just leave recvlowat data,
                    
470   * into the kernel buffer (using a read with MSG_PEEK), thus making
                    
471   * select think, that the socket is ready for reading.
                    
471   * select think, that the socket is ready for reading.
                    
472   * MSG_PEEK is only used with berkeley style sockets.
                    
473   */
                    
                
mptcp_connect.c https://github.com/tiwai/sound.git | C | 1361 lines
                    
113	fprintf(stderr,
                    
114		"\t-P [saveWithPeek|saveAfterPeek] -- save data with/after MSG_PEEK form tcp socket\n");
                    
115	fprintf(stderr, "\t-t num -- set poll timeout to num\n");
                    
528	if (cfg_peek == CFG_WITH_PEEK) {
                    
529		ret = recv(fd, buf, cap, MSG_PEEK);
                    
530		ret = (ret < 0) ? ret : read(fd, tmp, ret);
                    
531	} else if (cfg_peek == CFG_AFTER_PEEK) {
                    
532		ret = recv(fd, buf, cap, MSG_PEEK);
                    
533		ret = (ret < 0) ? ret : read(fd, buf, cap);
                    
                
netlink.c https://github.com/tiwai/sound.git | C | 858 lines
                    
136		multipart = false;
                    
137		len = netlink_recvmsg(sock, &mhdr, MSG_PEEK | MSG_TRUNC);
                    
138		if (len < 0) {
                    
                
af_mctp.c https://github.com/tiwai/sound.git | C | 689 lines
                    
215
                    
216	if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
                    
217		return -EOPNOTSUPP;
                    
                
natPlainDatagramSocketImplPosix.cc https://bitbucket.org/pizzafactory/pf-gcc.git | C++ | 858 lines
                    
203  ssize_t retlen =
                    
204    ::recvfrom (native_fd, (char *) NULL, 0, MSG_PEEK, (sockaddr*) &u,
                    
205      &addrlen);
                    
266  retlen =
                    
267    ::recvfrom (native_fd, (char *) dbytes, maxlen, MSG_PEEK, (sockaddr*) &u,
                    
268      &addrlen);
                    
                
virtio_transport_common.c https://gitlab.com/CadeLaRen/linux | C | 992 lines
                    
244{
                    
245	if (flags & MSG_PEEK)
                    
246		return -EOPNOTSUPP;
                    
                
socket.rb https://github.com/junxuan/JxVim.git | Ruby | 461 lines
                    
286    MSG_OOB = 0
                    
287    MSG_PEEK = 0
                    
288    MSG_RCVMORE = 0
                    
                
xp_socket.c https://gitlab.com/envieidoc/tomato | C | 838 lines
                    
37
                    
38#ifndef MSG_PEEK
                    
39# define MSG_PEEK 0
                    
295				} else if (php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) {
                    
296					if (0 >= recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) {
                    
297						alive = 0;
                    
371					if ((xparam->inputs.flags & STREAM_PEEK) == STREAM_PEEK) {
                    
372						flags |= MSG_PEEK;
                    
373					}
                    
                
dhcp-common.c https://gitlab.com/envieidoc/tomato | C | 905 lines
                    
45      msg->msg_flags = 0;
                    
46      while ((sz = recvmsg(fd, msg, MSG_PEEK | MSG_TRUNC)) == -1 && errno == EINTR);
                    
47      
                    
                
sock.c https://gitlab.com/envieidoc/tomato | C | 956 lines
                    
132		result = _recvfrom(socket, (void *) peek_buf, 1,
                    
133				   MSG_PEEK | MSG_DONTWAIT);
                    
134		if (result < 0)
                    
                
ipc_router_socket.c https://gitlab.com/webhaikal/SenseiOneplus3 | C | 693 lines
                    
387	if (!buf_len) {
                    
388		if (flags & MSG_PEEK)
                    
389			ret = msm_ipc_router_get_curr_pkt_size(port_ptr);
                    
                
RubySocket.java https://github.com/rkh/jruby.git | Java | 830 lines
                    
102    public static final int MSG_OOB = 0x1;
                    
103    public static final int MSG_PEEK = 0x2;
                    
104    public static final int MSG_DONTROUTE = 0x4;
                    
127        rb_mConstants.setConstant("MSG_OOB", runtime.newFixnum(MSG_OOB));
                    
128        rb_mConstants.setConstant("MSG_PEEK", runtime.newFixnum(MSG_PEEK));
                    
129        rb_mConstants.setConstant("MSG_DONTROUTE", runtime.newFixnum(MSG_DONTROUTE));
                    
                
poll.c https://github.com/rofl0r/gnulib.git | C | 604 lines
                    
65
                    
66/* BeOS does not have MSG_PEEK.  */
                    
67#ifndef MSG_PEEK
                    
67#ifndef MSG_PEEK
                    
68# define MSG_PEEK 0
                    
69#endif
                    
238      WSASetLastError (0);
                    
239      r = recv (h, data, sizeof (data), MSG_PEEK);
                    
240      error = WSAGetLastError ();
                    
276# if defined __MACH__ && defined __APPLE__
                    
277      /* There is a bug in Mac OS X that causes it to ignore MSG_PEEK
                    
278         for some kinds of descriptors.  Detect if this descriptor is a
                    
280         0-byte recv, and use ioctl(2) to detect POLLHUP.  */
                    
281      r = recv (fd, NULL, 0, MSG_PEEK);
                    
282      socket_errno = (r < 0) ? errno : 0;
                    
                
comm.c https://github.com/ncsurobotics/libseawolf.git | C | 613 lines
                    
181
                    
182    n = recv(comm_socket, &total_data_size, sizeof(uint16_t), MSG_WAITALL|MSG_PEEK);
                    
183    if(n != sizeof(uint16_t)) {
                    
                
DualStackPlainDatagramSocketImpl.c https://github.com/ikeji/openjdk7-jdk.git | C | 496 lines
                    
56        }
                    
57        if (recvfrom(fd, buf, 1, MSG_PEEK,
                    
58                         (struct sockaddr *)&rmtaddr, &addrlen) != JVM_IO_ERR) {
                    
251    if (peek) {
                    
252        flags = MSG_PEEK;
                    
253    }
                    
                
test_sockets.c https://gitlab.com/lotlab-mirror/lwip-mirror | C | 852 lines
                    
163
                    
164  ret = lwip_recv(s2, buf, 3, MSG_PEEK);
                    
165  fail_unless(ret == 3);
                    
166
                    
167  ret = lwip_recv(s2, buf, 3, MSG_PEEK);
                    
168  fail_unless(ret == 3);
                    
                
ksocket.c https://github.com/richlowe/illumos-gate.git | C | 933 lines
                    
379	msghdr.msg_controllen = 0;
                    
380	msghdr.msg_flags = flags & (MSG_OOB | MSG_PEEK | MSG_WAITALL |
                    
381	    MSG_DONTWAIT | MSG_USERSPACE);
                    
432	msghdr.msg_controllen = 0;
                    
433	msghdr.msg_flags = flags & (MSG_OOB | MSG_PEEK | MSG_WAITALL |
                    
434	    MSG_DONTWAIT | MSG_USERSPACE);
                    
489
                    
490	msg->msg_flags = flags & (MSG_OOB | MSG_PEEK | MSG_WAITALL |
                    
491	    MSG_DONTWAIT | MSG_USERSPACE);
                    
                
_remote_socket.py https://github.com/theosp/google_appengine.git | Python | 1180 lines
                    
61
                    
62MSG_PEEK = 2
                    
63MSG_WAITALL = 256
                    
                
watchman.c https://gitlab.com/lokiexinferis/vim-configs | C | 660 lines
                    
18#include <sys/errno.h>  /* for errno */
                    
19#include <sys/socket.h> /* for recv(), MSG_PEEK */
                    
20
                    
                
TSocket.cpp https://bitbucket.org/pawelulita/zpr_projekt.git | C++ | 823 lines
                    
161  uint8_t buf;
                    
162  int r = recv(socket_, cast_sockopt(&buf), 1, MSG_PEEK);
                    
163  if (r == -1) {
                    
                
netshm.c https://bitbucket.org/robinreal/rtnetts.git | C | 501 lines
                    
152
                    
153                ret = priv->sock_recvmsg(priv->sock_ctx, 0, &msg, MSG_PEEK);
                    
154                if (ret < 0) {
                    
                
DatagramChannelImpl.c https://github.com/ikeji/openjdk7-jdk.git | C | 247 lines
                    
92        }
                    
93        if (recvfrom(fd, buf, 1, MSG_PEEK,
                    
94                     (struct sockaddr *)&sa, &addrlen) != SOCKET_ERROR) {
                    
                
sockets.constants.html https://bitbucket.org/thncr/manuals.git | HTML | 2251 lines
                    
160   <span class="term">
                    
161    <strong><code>MSG_PEEK</code></strong> 
                    
162    (<span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span>)
                    
                
function.socket-recv.html https://bitbucket.org/thncr/manuals.git | HTML | 227 lines
                    
125         <tr>
                    
126          <td><strong><code>MSG_PEEK</code></strong></td>
                    
127          <td>
                    
                
extconf.rb https://gitlab.com/MichelZuniga/ruby | Ruby | 693 lines
                    
123
                    
124RECVMSG_WITH_MSG_PEEK_ALLOCATE_FD_TEST = <<'EOF'
                    
125#include <stdlib.h>
                    
192
                    
193    ss = recvmsg(sv[1], &r_msg, MSG_PEEK);
                    
194    if (ss == -1) { perror("recvmsg"); exit(EXIT_FAILURE); }
                    
244
                    
245def test_recvmsg_with_msg_peek_creates_fds(headers)
                    
246  case RUBY_PLATFORM
                    
247  when /linux/
                    
248    # Linux 2.6.38 allocate fds by recvmsg with MSG_PEEK.
                    
249    close_fds = true
                    
251    # FreeBSD 8.2.0, NetBSD 5 and MacOS X Snow Leopard doesn't
                    
252    # allocate fds by recvmsg with MSG_PEEK.
                    
253    # [ruby-dev:44189]
                    
                
sendrecv.c https://bitbucket.org/freebsd/freebsd-base.git | C | 1110 lines
                    
177    /*
                    
178     * Check if we have a valid address. recvfrom() with MSG_PEEK may return
                    
179     * success without filling in the address.
                    
                
socket_posix.cc https://gitlab.com/hkratz/chromium | C++ | 487 lines
                    
200  char c;
                    
201  int rv = HANDLE_EINTR(recv(socket_fd_, &c, 1, MSG_PEEK));
                    
202  if (rv == 0)
                    
218  char c;
                    
219  int rv = HANDLE_EINTR(recv(socket_fd_, &c, 1, MSG_PEEK));
                    
220  if (rv >= 0)
                    
                
ngx_http_copy_module.c https://bitbucket.org/chobits/ngx_module_practice.git | C | 1813 lines
                    
268    /* detect whether connection is closed by peer */
                    
269    n = recv(c->fd, buf, 1, MSG_PEEK);
                    
270
                    
                
test_sockmap.c https://gitlab.com/kush/linux | C | 1849 lines
                    
445{
                    
446	struct msghdr msg = {0}, msg_peek = {0};
                    
447	int err, i, flags = MSG_NOSIGNAL;
                    
454	if (peek_flag) {
                    
455		err = msg_alloc_iov(&msg_peek, iov_count, iov_length, data, tx);
                    
456		if (err)
                    
530			if (peek_flag) {
                    
531				flags |= MSG_PEEK;
                    
532				recvp = recvmsg(fd, &msg_peek, flags);
                    
563				if (recvp) {
                    
564					errno = msg_verify_data(&msg_peek,
                    
565								recvp,
                    
567					if (errno) {
                    
568						perror("data verify msg_peek failed\n");
                    
569						goto out_errno;
                    
                
tcp_bpf.c https://gitlab.com/kush/linux | C | 691 lines
                    
45	struct iov_iter *iter = &msg->msg_iter;
                    
46	int peek = flags & MSG_PEEK;
                    
47	int i, ret, copied = 0;
                    
                
socket_types.hpp https://gitlab.com/cdeclare/intcrypt | C++ Header | 406 lines
                    
133# define BOOST_ASIO_OS_DEF_MSG_OOB 0x1
                    
134# define BOOST_ASIO_OS_DEF_MSG_PEEK 0x2
                    
135# define BOOST_ASIO_OS_DEF_MSG_DONTROUTE 0x4
                    
217# define BOOST_ASIO_OS_DEF_MSG_OOB MSG_OOB
                    
218# define BOOST_ASIO_OS_DEF_MSG_PEEK MSG_PEEK
                    
219# define BOOST_ASIO_OS_DEF_MSG_DONTROUTE MSG_DONTROUTE
                    
332# define BOOST_ASIO_OS_DEF_MSG_OOB MSG_OOB
                    
333# define BOOST_ASIO_OS_DEF_MSG_PEEK MSG_PEEK
                    
334# define BOOST_ASIO_OS_DEF_MSG_DONTROUTE MSG_DONTROUTE
                    
                
Connection.py https://gitlab.com/sbDevGit/ZeroNet | Python | 450 lines
                    
114            try:
                    
115                if sock.recv(1, gevent.socket.MSG_PEEK) == "\x16":
                    
116                    self.log("Crypt in connection using implicit SSL")
                    
                
socket-io.c https://bitbucket.org/luobailiang/mono.git | C | 2100 lines
                    
324	if (sflags & SocketFlags_Peek)
                    
325		flags |= MSG_PEEK;
                    
326	if (sflags & SocketFlags_DontRoute)
                    
                
poll.c https://github.com/ejgarcia/isabel.git | C | 598 lines
                    
65
                    
66/* BeOS does not have MSG_PEEK.  */
                    
67#ifndef MSG_PEEK
                    
67#ifndef MSG_PEEK
                    
68# define MSG_PEEK 0
                    
69#endif
                    
238      WSASetLastError (0);
                    
239      r = recv (h, data, sizeof (data), MSG_PEEK);
                    
240      error = WSAGetLastError ();
                    
276# if defined __MACH__ &amp;&amp; defined __APPLE__
                    
277      /* There is a bug in Mac OS X that causes it to ignore MSG_PEEK
                    
278         for some kinds of descriptors.  Detect if this descriptor is a
                    
280         0-byte recv, and use ioctl(2) to detect POLLHUP.  */
                    
281      r = recv (fd, NULL, 0, MSG_PEEK);
                    
282      socket_errno = (r &lt; 0) ? errno : 0;
                    
                
remove-glibc-headers.patch https://github.com/e3c/openembedded.git | Patch | 944 lines
                    
161-    MSG_PEEK		= 0x02,	/* Peek at incoming messages.  */
                    
162-#define MSG_PEEK	MSG_PEEK
                    
163-    MSG_DONTROUTE	= 0x04,	/* Don't use local routing.  */
                    
                
socket.d https://gitlab.com/4144/gcc | D | 1851 lines
                    
127MSG_OOB
                    
128MSG_PEEK
                    
129MSG_TRUNC
                    
546        MSG_OOB         = 0x01,
                    
547        MSG_PEEK        = 0x02,
                    
548        MSG_TRUNC       = 0x20,
                    
                
secure-server.c https://gitlab.com/david.furminieux/zephyr-os | C | 862 lines
                    
95
                    
96  bytes = recvmsg(sockfd, &msg, MSG_DONTWAIT | MSG_PEEK);
                    
97  if (bytes < 0) {
                    
                
libgenl.c https://bitbucket.org/cloudfounders/drbd-8.4.git | C | 847 lines
                    
141
                    
142	flags = MSG_PEEK;
                    
143retry:
                    
                
bgp_tcpsig.c https://gitlab.com/envieidoc/advancedtomato2 | C | 573 lines
                    
224
                    
225  rlen = recv(fd, &smsg, sizeof(smsg), MSG_PEEK);
                    
226  if (rlen == -1)
                    
                
netlink-socket.c https://gitlab.com/unofficial-mirrors/systemd | C | 463 lines
                    
264
                    
265        n = recvmsg(fd, &msg, MSG_TRUNC | (peek ? MSG_PEEK : 0));
                    
266        if (n < 0) {
                    
                
lwIP__Sockets.cpp https://bitbucket.org/pmfsampaio/netmf-lpc.git | C++ | 1124 lines
                    
188        case SOCKET_READ_PEEK_OPTION:
                    
189            nativeFlag = MSG_PEEK;
                    
190            break;
                    
                
rtpnet.h https://bitbucket.org/pmfsampaio/netmf-lpc.git | C Header | 304 lines
                    
181#define RTP_NET_MSG_OOB                 MSG_OOB            /* process out-of-band data */
                    
182#define RTP_NET_MSG_PEEK                MSG_PEEK           /* peek at incoming message */
                    
183#define RTP_NET_MSG_DONTROUTE           MSG_DONTROUTE      /* send without using routing tables */
                    
                
RTIP__Sockets.cpp https://bitbucket.org/pmfsampaio/netmf-lpc.git | C++ | 1173 lines
                    
278        case SOCKET_READ_PEEK_OPTION:
                    
279            nativeFlag = RTP_NET_MSG_PEEK;
                    
280            break;
                    
                
sockets.c https://github.com/stefanizota/smalltalk.git | C | 549 lines
                    
179constantFunction (msgOOB, MSG_OOB);
                    
180constantFunction (msgPeek, MSG_PEEK);
                    
181constantFunction (solSocket, SOL_SOCKET);
                    
                
constants.h https://github.com/manishasarkar/rhodes.git | C Header | 1027 lines
                    
330#ifdef MSG_PEEK
                    
331    sock_define_const("MSG_PEEK", MSG_PEEK);
                    
332#endif
                    
                
admin.c https://bitbucket.org/killerpenguinassassins/open_distrib_devel.git | C | 763 lines
                    
120	/* get buffer length */
                    
121	while ((len = recv(so2, (char *)&com, sizeof(com), MSG_PEEK)) < 0) {
                    
122		if (errno == EINTR)
                    
                
 

Source

Language