PageRenderTime 858ms queryTime 115ms sortTime 2ms getByIdsTime 429ms findMatchingLines 210ms

100+ results results for 'MSG_PEEK repo:jwg286/freebsd_usb' (858 ms)

Not the results you expected?
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/wesen/lemonix.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"
                    
                
datagram.c https://github.com/gtvhacker/Logitech-Revue.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);
                    
                
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
                    
                
sockets.h https://github.com/bomma/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 */
                    
                
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
                    
                
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
                    
                
os_socket.h https://github.com/InkVisible/wow.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
                    
                
socket_base.hpp https://github.com/RedBeard0531/mongo.git | 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,
                    
                
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)
                    
                
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
                    
                
socket_types.hpp https://bitbucket.org/vrrm/brl-cad-copy-for-fast-history-browsing-in-git.git | C++ Header | 208 lines
                    
148const int shutdown_both = SD_BOTH;
                    
149const int message_peek = MSG_PEEK;
                    
150const int message_out_of_band = MSG_OOB;
                    
187const int shutdown_both = SHUT_RDWR;
                    
188const int message_peek = MSG_PEEK;
                    
189const int message_out_of_band = MSG_OOB;
                    
                
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
                    
                
mod_jaxer_message.h https://github.com/hpaulo/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
                    
                
recvfrom_spec.rb https://github.com/shugo/jruby.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)
                    
                
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    }
                    
                
netlink-types.h https://gitlab.com/brian0218/rk3066_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/rk3066_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)
                    
                
libnetlink.c https://gitlab.com/brian0218/rk3188_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) {
                    
                
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).
                    
                
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.
                    
                
PlainDatagramSocketImpl.java https://github.com/TaintDroid/android_platform_libcore.git | Java | 240 lines
                    
173    public int peekData(DatagramPacket pack) throws IOException {
                    
174        doRecv(pack, MSG_PEEK);
                    
175        return pack.getPort();
                    
                
vsock_test.c git://github.com/torvalds/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	},
                    
                
socket.c https://bitbucket.org/an0nym0us_/zimage-mod.git | C | 835 lines
                    
160	if (len < copied) {
                    
161		if (flags & MSG_PEEK)
                    
162			atomic_dec(&skb->users);
                    
                
datagram.c https://bitbucket.org/droidzone/supernova-kernel.git | C | 777 lines
                    
187			*peeked = skb->peeked;
                    
188			if (flags & MSG_PEEK) {
                    
189				skb->peeked = 1;
                    
258 *
                    
259 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
260 *	receive queue of the socket, it will be taken off the queue
                    
273
                    
274	if (flags & MSG_PEEK) {
                    
275		err = -ENOENT;
                    
                
virtio_transport_common.c https://gitlab.com/CadeLaRen/linux | C | 992 lines
                    
244{
                    
245	if (flags & MSG_PEEK)
                    
246		return -EOPNOTSUPP;
                    
                
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)
                    
                
datagram.c https://gitlab.com/envieidoc/sprd_project | 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;
                    
                
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);
                    
                
datagram.c https://gitlab.com/culot/kernel_lge_madai | 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;
                    
                
datagram.c https://bitbucket.org/olivier_pitton/linux-3.8.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;
                    
                
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
                    
                
poll.c https://gitlab.com/wilfred/guile | C | 594 lines
                    
67
                    
68/* BeOS does not have MSG_PEEK.  */
                    
69#ifndef MSG_PEEK
                    
69#ifndef MSG_PEEK
                    
70# define MSG_PEEK 0
                    
71#endif
                    
245      WSASetLastError (0);
                    
246      r = recv (h, data, sizeof (data), MSG_PEEK);
                    
247      error = WSAGetLastError ();
                    
283# if defined __MACH__ && defined __APPLE__
                    
284      /* There is a bug in Mac OS X that causes it to ignore MSG_PEEK
                    
285         for some kinds of descriptors.  Detect if this descriptor is a
                    
287         0-byte recv, and use ioctl(2) to detect POLLHUP.  */
                    
288      r = recv (fd, NULL, 0, MSG_PEEK);
                    
289      socket_errno = (r < 0) ? errno : 0;
                    
                
vchiq_shim.c https://gitlab.com/openbar/rpi-linux | C | 860 lines
                    
82/***********************************************************
                    
83 * Name: vchi_msg_peek
                    
84 *
                    
98 ***********************************************************/
                    
99int32_t vchi_msg_peek(VCHI_SERVICE_HANDLE_T handle,
                    
100	void **data,
                    
120}
                    
121EXPORT_SYMBOL(vchi_msg_peek);
                    
122
                    
128 * Description: Routine to remove a message (after it has been read with
                    
129 *              vchi_msg_peek)
                    
130 *
                    
                
mptcp_connect.c https://gitlab.com/deepcypher/linux | 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);
                    
                
test_sockmap.c https://gitlab.com/deepcypher/linux | C | 2056 lines
                    
553{
                    
554	struct msghdr msg = {0}, msg_peek = {0};
                    
555	int err, i, flags = MSG_NOSIGNAL;
                    
566	if (peek_flag) {
                    
567		err = msg_alloc_iov(&msg_peek, iov_count, iov_length, data, tx);
                    
568		if (err)
                    
648			if (peek_flag) {
                    
649				flags |= MSG_PEEK;
                    
650				recvp = recvmsg(fd, &msg_peek, flags);
                    
                
netlink.c https://gitlab.com/deepcypher/linux | C | 858 lines
                    
136		multipart = false;
                    
137		len = netlink_recvmsg(sock, &mhdr, MSG_PEEK | MSG_TRUNC);
                    
138		if (len < 0) {
                    
                
af_mctp.c https://gitlab.com/deepcypher/linux | C | 689 lines
                    
215
                    
216	if (flags & ~(MSG_DONTWAIT | MSG_TRUNC | MSG_PEEK))
                    
217		return -EOPNOTSUPP;
                    
                
skmsg.c https://gitlab.com/deepcypher/linux | C | 1238 lines
                    
415	struct iov_iter *iter = &msg->msg_iter;
                    
416	int peek = flags & MSG_PEEK;
                    
417	struct sk_msg *msg_rx;
                    
                
datagram.c https://gitlab.com/deepcypher/linux | C | 835 lines
                    
174
                    
175	if (unlikely(flags & MSG_PEEK && *off >= 0)) {
                    
176		peek_at_off = true;
                    
181	skb_queue_walk(queue, skb) {
                    
182		if (flags & MSG_PEEK) {
                    
183			if (peek_at_off && _off >= skb->len &&
                    
353
                    
354	if (flags & MSG_PEEK) {
                    
355		err = -ENOENT;
                    
381 *
                    
382 *	If the MSG_PEEK flag is set, and the packet is still on the
                    
383 *	receive queue of the socket, it will be taken off the queue
                    
                
socket.c https://gitlab.com/deepcypher/linux | C | 825 lines
                    
147	if (len < copied) {
                    
148		if (flags & MSG_PEEK)
                    
149			refcount_dec(&skb->users);
                    
                
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]
                    
                
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)
                    
                
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;
                    
                
recvmsg.c https://gitlab.com/kush/linux | C | 761 lines
                    
120
                    
121	if (ret == 0 && !(flags & MSG_PEEK)) {
                    
122		_debug("to be accepted");
                    
345
                    
346		if (!(flags & MSG_PEEK))
                    
347			trace_rxrpc_receive(call, rxrpc_receive_front,
                    
396		last = sp->hdr.flags & RXRPC_LAST_PACKET;
                    
397		if (!(flags & MSG_PEEK))
                    
398			rxrpc_rotate_rx_window(call);
                    
411out:
                    
412	if (!(flags & MSG_PEEK)) {
                    
413		call->rx_pkt_offset = rx_pkt_offset;
                    
491	call = list_entry(l, struct rxrpc_call, recvmsg_link);
                    
492	if (!(flags & MSG_PEEK))
                    
493		list_del_init(&call->recvmsg_link);
                    
                
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.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) {
                    
                
bgp_tcpsig.c https://gitlab.com/envieidoc/tomato | 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) {
                    
                
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)
                    
                
test_sockmap.c https://gitlab.com/lszubowi/kernel-ark | C | 2055 lines
                    
555{
                    
556	struct msghdr msg = {0}, msg_peek = {0};
                    
557	int err, i, flags = MSG_NOSIGNAL;
                    
568	if (peek_flag) {
                    
569		err = msg_alloc_iov(&msg_peek, iov_count, iov_length, data, tx);
                    
570		if (err)
                    
650			if (peek_flag) {
                    
651				flags |= MSG_PEEK;
                    
652				recvp = recv
                    
                
libpfk.cpp https://gitlab.com/mvives/ike | C++ | 1848 lines
                    
95
                    
96		long result = recv( conn, msg.buff(), msg_size, MSG_PEEK );
                    
97		if( result < 0 )
                    
                
socket.c git://pkgs.fedoraproject.org/cntlm | C | 284 lines
                    
210	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
                    
211	i = recv(fd, &buf, 1, MSG_PEEK);
                    
212	fcntl(fd, F_SETFL, flags);
                    
213#else
                    
214	i = recv(fd, &buf, 1, MSG_DONTWAIT | MSG_PEEK);
                    
215#endif
                    
                
natPlainDatagramSocketImplPosix.cc https://gitlab.com/lobl.pavel/gcc-6.2.0 | C++ | 852 lines
                    
198  ssize_t retlen =
                    
199    ::recvfrom (native_fd, (char *) NULL, 0, MSG_PEEK, (sockaddr*) &u,
                    
200      &addrlen);
                    
261  retlen =
                    
262    ::recvfrom (native_fd, (char *) dbytes, maxlen, MSG_PEEK, (sockaddr*) &u,
                    
263      &addrlen);
                    
                
TSocket.cpp https://gitlab.com/sudarsunkannan/mapkeeper | C++ | 823 lines
                    
161  uint8_t buf;
                    
162  int r = recv(socket_, cast_sockopt(&buf), 1, MSG_PEEK);
                    
163  if (r == -1) {
                    
                
SSL_SOCK_Stream.cpp https://github.com/InkVisible/wow.git | C++ | 630 lines
                    
394    {
                    
395      if ((flags | MSG_PEEK) != MSG_PEEK)
                    
396        {
                    
443    {
                    
444      if ((flags | MSG_PEEK) != MSG_PEEK)
                    
445        {
                    
                
svcsock.c https://github.com/kingklick/kk-incredible-kernel.git | C | 1567 lines
                    
539	err = kernel_recvmsg(svsk->sk_sock, &msg, NULL,
                    
540			     0, 0, MSG_PEEK | MSG_DONTWAIT);
                    
541	if (err >= 0)
                    
                
iosystem.cpp https://bitbucket.org/tekkamanendless/dangerous-snmp.git | C++ | 608 lines
                    
205			char byte = 0;
                    
206			int bytesAvailable = recv( entry.first, &byte, sizeof(byte), MSG_PEEK | MSG_DONTWAIT );
                    
207			if( bytesAvailable == 0 ) {
                    
                
sock_symbian.cpp https://bitbucket.org/bohlooli/csipsimple.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/csipsimple.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/csipsimple.git | Module-Definition | 323 lines
                    
23	pj_MSG_OOB                               @ 22 NONAME
                    
24	pj_MSG_PEEK                              @ 23 NONAME
                    
25	pj_NO_MEMORY_EXCEPTION                   @ 24 NONAME
                    
                
test1.c https://gitlab.com/o1s2/selflrrn | C | 208 lines
                    
34
                    
35#ifndef	MSG_PEEK
                    
36	printf("+ MSG_PEEK not defined\n");
                    
                
fh_tcp.c https://github.com/csinitiative/fhce.git | C | 623 lines
                    
405
                    
406        if (flags != MSG_PEEK) {
                    
407            nleft -= nread;
                    
504
                    
505        if (flags != MSG_PEEK) {
                    
506            nleft -= nread;
                    
543{
                    
544    return fh_tcp_readex(s, buf, nbytes, MSG_PEEK);
                    
545}
                    
                
socket-io.c https://github.com/sdether/mono.git | C | 2083 lines
                    
324	if (sflags & SocketFlags_Peek)
                    
325		flags |= MSG_PEEK;
                    
326	if (sflags & SocketFlags_DontRoute)
                    
                
socket.rb https://github.com/junxuan/JxVim.git | Ruby | 461 lines
                    
286    MSG_OOB = 0
                    
287    MSG_PEEK = 0
                    
288    MSG_RCVMORE = 0
                    
                
net.rs https://gitlab.com/jianglu/rust | Rust | 424 lines
                    
12use io;
                    
13use libc::{self, c_int, c_void, size_t, sockaddr, socklen_t, EAI_SYSTEM, MSG_PEEK};
                    
14use mem;
                    
247    pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> {
                    
248        self.recv_with_flags(buf, MSG_PEEK)
                    
249    }
                    
271    pub fn peek_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> {
                    
272        self.recv_from_with_flags(buf, MSG_PEEK)
                    
273    }
                    
                
udp.rs https://gitlab.com/jianglu/rust | Rust | 1163 lines
                    
137    /// Successive calls return the same data. This is accomplished by passing
                    
138    /// `MSG_PEEK` as a flag to the underlying `recvfrom` system call.
                    
139    ///
                    
                
knet.h https://gitlab.com/vascocosta/os | C Header | 1792 lines
                    
160// of data if the socket is a message-based socket, if a signal is caught, if
                    
161// the connection is terminated, is MSG_PEEK was specified, or if an error is
                    
162// pending for the socket.
                    
                
socket.h https://gitlab.com/vascocosta/os | C Header | 1330 lines
                    
176
                    
177#define MSG_PEEK 0x00000001
                    
178
                    
190// of data if the socket is a message-based socket, if a signal is caught, if
                    
191// the connection is terminated, is MSG_PEEK was specified, or if an error is
                    
192// pending for the socket.
                    
                
socket.c https://gitlab.com/vascocosta/os | C | 1873 lines
                    
55#define ASSERT_SOCKET_IO_FLAGS_ARE_EQUIVALENT()           \
                    
56    ASSERT((MSG_PEEK == SOCKET_IO_PEEK) &&                \
                    
57           (MSG_OOB == SOCKET_IO_OUT_OF_BAND) &&          \
                    
                
ar-recvmsg.c https://gitlab.com/deadnem/Singularity | C | 442 lines
                    
89			if (copied &&
                    
90			    (flags & MSG_PEEK || timeo == 0))
                    
91				goto out;
                    
201
                    
202		if (!(flags & MSG_PEEK))
                    
203			sp->offset = offset;
                    
220			/* last bit of request received */
                    
221			if (!(flags & MSG_PEEK)) {
                    
222				_debug("eat packet");
                    
239
                    
240		if (flags & MSG_PEEK) {
                    
241			_debug("peek next");
                    
274			goto copy_error;
                    
275		if (!(flags & MSG_PEEK)) {
                    
276			if (skb_dequeue(&rx->sk.sk_receive_queue) != skb)
                    
                
mptcp_connect.c https://gitlab.com/pachecof/centos-stream-9 | C | 1263 lines
                    
108	fprintf(stderr,
                    
109		"\t-P [saveWithPeek|saveAfterPeek] -- save data with/after MSG_PEEK form tcp socket\n");
                    
110	exit(1);
                    
512	if (cfg_peek == CFG_WITH_PEEK) {
                    
513		ret = recv(fd, buf, cap, MSG_PEEK);
                    
514		ret = (ret < 0) ? ret : read(fd, tmp, ret);
                    
515	} else if (cfg_peek == CFG_AFTER_PEEK) {
                    
516		ret = recv(fd, buf, cap, MSG_PEEK);
                    
517		ret = (ret < 0) ? ret : read(fd, buf, cap);
                    
                
smart_route.py https://gitlab.com/Mirros/XX-net | Python | 545 lines
                    
128    else:
                    
129        leadbyte = sock.recv(1, socket.MSG_PEEK)
                    
130
                    
133            for _ in xrange(2):
                    
134                leaddata = left_buf + sock.recv(1024, socket.MSG_PEEK)
                    
135                if is_clienthello(leaddata):
                    
148    for _ in xrange(2):
                    
149        leaddata = left_buf + sock.recv(65535, socket.MSG_PEEK)
                    
150        if leaddata:
                    
294    else:
                    
295        leadbyte = sock.recv(1, socket.MSG_PEEK)
                    
296        if leadbyte in ('\x80', '\x16'):
                    
                
library.c https://gitlab.com/oytunistrator/phpredis | C | 1732 lines
                    
145     * There is a bug in php socket stream to check liveness of a connection:
                    
146     * if (0 >= recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) {
                    
147     *    alive = 0;
                    
                
socket_base.hpp https://github.com/afrancois/Cinder.git | C++ Header | 559 lines
                    
68  ASIO_STATIC_CONSTANT(int,
                    
69      message_peek = ASIO_OS_DEF(MSG_PEEK));
                    
70  ASIO_STATIC_CONSTANT(int,
                    
                
LSOCK.cpp https://bitbucket.org/oregon/oregoncore/ | C++ | 184 lines
                    
134                                    &recv_msg,
                    
135                                    MSG_PEEK);
                    
136
                    
143#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG)
                    
144          // Close down the socket that was returned by the MSG_PEEK.
                    
145          cmsghdr  *cmsgptr = (cmsghdr *) cmsgbuf;
                    
                
tcpstream.cpp https://github.com/popovag/multitheftauto.git | C++ | 114 lines
                    
49  {
                    
50    len = recv(m_handle, (void *)&tmp, sizeof(char), MSG_TRUNC | MSG_PEEK);
                    
51    if (len < 0)
                    
                
socket.scm https://code.google.com/p/sagittarius-scheme/ | Scheme | 92 lines
                    
62	    MSG_OOB
                    
63	    MSG_PEEK
                    
64	    MSG_DONTROUTE
                    
                
TSocket.cpp https://gitlab.com/peter.tiedemann/thrift | C++ | 933 lines
                    
213  uint8_t buf;
                    
214  int r = static_cast<int>(recv(socket_, cast_sockopt(&buf), 1, MSG_PEEK));
                    
215  if (r == -1) {
                    
                
socket.d https://gitlab.com/adotout/gcc | D | 1891 lines
                    
128MSG_OOB
                    
129MSG_PEEK
                    
130MSG_TRUNC
                    
525        MSG_OOB         = 0x01,
                    
526        MSG_PEEK        = 0x02,
                    
527        MSG_TRUNC       = 0x20,
                    
665        MSG_OOB         = 0x1,
                    
666        MSG_PEEK        = 0x2,
                    
667        MSG_TRUNC       = 0x10,
                    
                
RubySocket.java https://github.com/gilmation/jruby.git | Java | 786 lines
                    
101    public static final int MSG_OOB = 0x1;
                    
102    public static final int MSG_PEEK = 0x2;
                    
103    public static final int MSG_DONTROUTE = 0x4;
                    
126        rb_mConstants.fastSetConstant("MSG_OOB", runtime.newFixnum(MSG_OOB));
                    
127        rb_mConstants.fastSetConstant("MSG_PEEK", runtime.newFixnum(MSG_PEEK));
                    
128        rb_mConstants.fastSetConstant("MSG_DONTROUTE", runtime.newFixnum(MSG_DONTROUTE));
                    
                
socket_test.py https://github.com/thomo13/ironruby.git | Python | 651 lines
                    
136                 "MSG_OOB" : 1,
                    
137                 "MSG_PEEK" : 2,
                    
138                 "MSG_TRUNC" : 32,
                    
                
netlink-types.h https://gitlab.com/obay/batphone_adhoc | C Header | 758 lines
                    
23#define NL_OWN_PORT		(1<<2)
                    
24#define NL_MSG_PEEK		(1<<3)
                    
25
                    
                
AsyncGssSocketLayer.cpp https://github.com/migueld/plex.git | C++ | 1193 lines
                    
230After decryption, it adds \r\n to the end of the buffer.
                    
231This method currently does not handle the MSG_PEEK flag, it also ignores nBufLen.
                    
232*/
                    
                
ofxTCPManager.cpp https://gitlab.com/cocoroac/walkingartists | C++ | 605 lines
                    
111    char buffer;
                    
112    int ret = recv(m_hSocket, &buffer, 1, MSG_PEEK);
                    
113    SetNonBlocking(wasBlocking);
                    
433 
                    
434	return recv(m_hSocket, pBuff, iSize, MSG_PEEK);
                    
435}
                    
                
vqp.c https://github.com/mikeross/freeradius-server.git | C | 698 lines
                    
166	 */
                    
167	data_len = recvfrom(sockfd, header, sizeof(header), MSG_PEEK,
                    
168			    (struct sockaddr *)&src, &sizeof_src);
                    
                
 

Source

Language