Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3)

Side by Side Diff: src/pkg/runtime/netpoll_epoll.c

Issue 137020043: code review 137020043: cmd/cc: generate error if #pragma pack off does anything (Closed)
Patch Set: diff -r 0e9f269a9c70e32cb6357c5ca01d1a88064e43f7 https://code.google.com/p/go/ Created 10 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/runtime/defs_linux_amd64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Go Authors. All rights reserved. 1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // +build linux 5 // +build linux
6 6
7 #include "runtime.h" 7 #include "runtime.h"
8 #include "defs_GOOS_GOARCH.h" 8 #include "defs_GOOS_GOARCH.h"
9 9
10 int32 runtime·epollcreate(int32 size); 10 int32 runtime·epollcreate(int32 size);
(...skipping 19 matching lines...) Expand all
30 runtime·throw("netpollinit: failed to create descriptor"); 30 runtime·throw("netpollinit: failed to create descriptor");
31 } 31 }
32 32
33 int32 33 int32
34 runtime·netpollopen(uintptr fd, PollDesc *pd) 34 runtime·netpollopen(uintptr fd, PollDesc *pd)
35 { 35 {
36 EpollEvent ev; 36 EpollEvent ev;
37 int32 res; 37 int32 res;
38 38
39 ev.events = EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET; 39 ev.events = EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET;
40 » ev.data = (uint64)pd; 40 » *(uintptr*)ev.data = (uintptr)pd;
41 res = runtime·epollctl(epfd, EPOLL_CTL_ADD, (int32)fd, &ev); 41 res = runtime·epollctl(epfd, EPOLL_CTL_ADD, (int32)fd, &ev);
42 return -res; 42 return -res;
43 } 43 }
44 44
45 int32 45 int32
46 runtime·netpollclose(uintptr fd) 46 runtime·netpollclose(uintptr fd)
47 { 47 {
48 EpollEvent ev; 48 EpollEvent ev;
49 int32 res; 49 int32 res;
50 50
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 mode += 'r'; 94 mode += 'r';
95 if(ev->events & (EPOLLOUT|EPOLLHUP|EPOLLERR)) 95 if(ev->events & (EPOLLOUT|EPOLLHUP|EPOLLERR))
96 mode += 'w'; 96 mode += 'w';
97 if(mode) 97 if(mode)
98 runtime·netpollready(&gp, (void*)ev->data, mode); 98 runtime·netpollready(&gp, (void*)ev->data, mode);
99 } 99 }
100 if(block && gp == nil) 100 if(block && gp == nil)
101 goto retry; 101 goto retry;
102 return gp; 102 return gp;
103 } 103 }
OLDNEW
« no previous file with comments | « src/pkg/runtime/defs_linux_amd64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b