├── .travis.yml ├── GoBlog ├── LICENSE.md ├── README.md ├── create.sh ├── css ├── animate.css ├── bootstrap.css └── main.css ├── img ├── anne.jpg ├── faraz.jpg └── zain.jpg ├── index.html ├── js ├── bootstrap.js ├── jquery.js ├── jquery_002.js └── wow.js ├── main.go ├── pages.go └── vendor ├── github.com ├── boltdb │ └── bolt │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── bolt_386.go │ │ ├── bolt_amd64.go │ │ ├── bolt_arm.go │ │ ├── bolt_arm64.go │ │ ├── bolt_linux.go │ │ ├── bolt_openbsd.go │ │ ├── bolt_ppc64le.go │ │ ├── bolt_s390x.go │ │ ├── bolt_unix.go │ │ ├── bolt_unix_solaris.go │ │ ├── bolt_windows.go │ │ ├── boltsync_unix.go │ │ ├── bucket.go │ │ ├── cursor.go │ │ ├── db.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── freelist.go │ │ ├── node.go │ │ ├── page.go │ │ └── tx.go └── gorilla │ ├── context │ ├── LICENSE │ ├── README.md │ ├── context.go │ └── doc.go │ └── mux │ ├── LICENSE │ ├── README.md │ ├── doc.go │ ├── mux.go │ ├── regexp.go │ └── route.go ├── golang.org └── x │ ├── crypto │ ├── bcrypt │ │ ├── base64.go │ │ └── bcrypt.go │ └── blowfish │ │ ├── block.go │ │ ├── cipher.go │ │ └── const.go │ └── sys │ └── unix │ ├── asm.s │ ├── asm_darwin_386.s │ ├── asm_darwin_amd64.s │ ├── asm_darwin_arm.s │ ├── asm_darwin_arm64.s │ ├── asm_dragonfly_386.s │ ├── asm_dragonfly_amd64.s │ ├── asm_freebsd_386.s │ ├── asm_freebsd_amd64.s │ ├── asm_freebsd_arm.s │ ├── asm_linux_386.s │ ├── asm_linux_amd64.s │ ├── asm_linux_arm.s │ ├── asm_linux_arm64.s │ ├── asm_linux_ppc64x.s │ ├── asm_netbsd_386.s │ ├── asm_netbsd_amd64.s │ ├── asm_netbsd_arm.s │ ├── asm_openbsd_386.s │ ├── asm_openbsd_amd64.s │ ├── asm_solaris_amd64.s │ ├── constants.go │ ├── env_unix.go │ ├── env_unset.go │ ├── flock.go │ ├── flock_linux_32bit.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── mksyscall.pl │ ├── mksyscall_solaris.pl │ ├── mksysctl_openbsd.pl │ ├── mksysnum_darwin.pl │ ├── mksysnum_dragonfly.pl │ ├── mksysnum_freebsd.pl │ ├── mksysnum_linux.pl │ ├── mksysnum_netbsd.pl │ ├── mksysnum_openbsd.pl │ ├── race.go │ ├── race0.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── str.go │ ├── syscall.go │ ├── syscall_bsd.go │ ├── syscall_darwin.go │ ├── syscall_darwin_386.go │ ├── syscall_darwin_amd64.go │ ├── syscall_darwin_arm.go │ ├── syscall_darwin_arm64.go │ ├── syscall_dragonfly.go │ ├── syscall_dragonfly_386.go │ ├── syscall_dragonfly_amd64.go │ ├── syscall_freebsd.go │ ├── syscall_freebsd_386.go │ ├── syscall_freebsd_amd64.go │ ├── syscall_freebsd_arm.go │ ├── syscall_linux.go │ ├── syscall_linux_386.go │ ├── syscall_linux_amd64.go │ ├── syscall_linux_arm.go │ ├── syscall_linux_arm64.go │ ├── syscall_linux_ppc64x.go │ ├── syscall_netbsd.go │ ├── syscall_netbsd_386.go │ ├── syscall_netbsd_amd64.go │ ├── syscall_netbsd_arm.go │ ├── syscall_no_getwd.go │ ├── syscall_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── types_darwin.go │ ├── types_dragonfly.go │ ├── types_freebsd.go │ ├── types_linux.go │ ├── types_netbsd.go │ ├── types_openbsd.go │ ├── types_solaris.go │ ├── zerrors_darwin_386.go │ ├── zerrors_darwin_amd64.go │ ├── zerrors_darwin_arm.go │ ├── zerrors_darwin_arm64.go │ ├── zerrors_dragonfly_386.go │ ├── zerrors_dragonfly_amd64.go │ ├── zerrors_freebsd_386.go │ ├── zerrors_freebsd_amd64.go │ ├── zerrors_freebsd_arm.go │ ├── zerrors_linux_386.go │ ├── zerrors_linux_amd64.go │ ├── zerrors_linux_arm.go │ ├── zerrors_linux_arm64.go │ ├── zerrors_linux_ppc64.go │ ├── zerrors_linux_ppc64le.go │ ├── zerrors_netbsd_386.go │ ├── zerrors_netbsd_amd64.go │ ├── zerrors_netbsd_arm.go │ ├── zerrors_openbsd_386.go │ ├── zerrors_openbsd_amd64.go │ ├── zerrors_solaris_amd64.go │ ├── zsyscall_darwin_386.go │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_arm.go │ ├── zsyscall_darwin_arm64.go │ ├── zsyscall_dragonfly_386.go │ ├── zsyscall_dragonfly_amd64.go │ ├── zsyscall_freebsd_386.go │ ├── zsyscall_freebsd_amd64.go │ ├── zsyscall_freebsd_arm.go │ ├── zsyscall_linux_386.go │ ├── zsyscall_linux_amd64.go │ ├── zsyscall_linux_arm.go │ ├── zsyscall_linux_arm64.go │ ├── zsyscall_linux_ppc64.go │ ├── zsyscall_linux_ppc64le.go │ ├── zsyscall_netbsd_386.go │ ├── zsyscall_netbsd_amd64.go │ ├── zsyscall_netbsd_arm.go │ ├── zsyscall_openbsd_386.go │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_solaris_amd64.go │ ├── zsysctl_openbsd.go │ ├── zsysnum_darwin_386.go │ ├── zsysnum_darwin_amd64.go │ ├── zsysnum_darwin_arm.go │ ├── zsysnum_darwin_arm64.go │ ├── zsysnum_dragonfly_386.go │ ├── zsysnum_dragonfly_amd64.go │ ├── zsysnum_freebsd_386.go │ ├── zsysnum_freebsd_amd64.go │ ├── zsysnum_freebsd_arm.go │ ├── zsysnum_linux_386.go │ ├── zsysnum_linux_amd64.go │ ├── zsysnum_linux_arm.go │ ├── zsysnum_linux_arm64.go │ ├── zsysnum_linux_ppc64.go │ ├── zsysnum_linux_ppc64le.go │ ├── zsysnum_netbsd_386.go │ ├── zsysnum_netbsd_amd64.go │ ├── zsysnum_netbsd_arm.go │ ├── zsysnum_openbsd_386.go │ ├── zsysnum_openbsd_amd64.go │ ├── zsysnum_solaris_amd64.go │ ├── ztypes_darwin_386.go │ ├── ztypes_darwin_amd64.go │ ├── ztypes_darwin_arm.go │ ├── ztypes_darwin_arm64.go │ ├── ztypes_dragonfly_386.go │ ├── ztypes_dragonfly_amd64.go │ ├── ztypes_freebsd_386.go │ ├── ztypes_freebsd_amd64.go │ ├── ztypes_freebsd_arm.go │ ├── ztypes_linux_386.go │ ├── ztypes_linux_amd64.go │ ├── ztypes_linux_arm.go │ ├── ztypes_linux_arm64.go │ ├── ztypes_linux_ppc64.go │ ├── ztypes_linux_ppc64le.go │ ├── ztypes_netbsd_386.go │ ├── ztypes_netbsd_amd64.go │ ├── ztypes_netbsd_arm.go │ ├── ztypes_openbsd_386.go │ ├── ztypes_openbsd_amd64.go │ └── ztypes_solaris_amd64.go └── vendor.json /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.5 4 | 5 | install: 6 | - export GO15VENDOREXPERIMENT=1 7 | - go get -v -t ./... 8 | 9 | script: export GO15VENDOREXPERIMENT=1 && go build -v ./... -------------------------------------------------------------------------------- /GoBlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GetGoBlog/GoBlog/30375728a8fc1fe26ae77cf43ee544a419a5ddef/GoBlog -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Our copyleft license is that anyone can use this code as long as the following conditions are met: 2 | 3 | Your end product is not profiting in any way, shape, or form from it 4 | Your end product is also open source 5 | You are giving GoBlog credit 6 | You inform me about your project 7 | 8 | Obviously, we aren't liable for anything that goes wrong from you using our code in any way, shape, or form. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GoBlog 2 | 3 | [![Build Status](https://travis-ci.org/GetGoBlog/GoBlog.svg?branch=master)](https://travis-ci.org/GetGoBlog/GoBlog) 4 | [![GoBlog](https://img.shields.io/badge/goblog.pw-online-brightgreen.svg)](http://www.goblog.pw) 5 | [![Go Report Card](https://goreportcard.com/badge/github.com/GetGoBlog/GoBlog)](https://goreportcard.com/report/github.com/GetGoBlog/GoBlog) 6 | [![Twitter](https://img.shields.io/twitter/url/https/github.com/getgoblog/goblog.svg?style=social?style=flat-square)](https://twitter.com/intent/tweet?text=Check out www.github.com/GetGoBlog/GoBlog an open-source blogging platform written in Go. Try it out free for life at http://goblog.pw) 7 | 8 | This is being rewritten from scratch (new platform and new blogging engine) soon -- stay tuned! 9 | 10 | GoBlog was our entry for the 2016 GopherGala. Try it out live at [https://www.goblog.pw](https://www.goblog.pw) 11 | 12 | GoBlog is a platform for easily deploying your own blog. Passwords are hashed with bcrypt. SSL/TLS via Let's Encrypt. 13 | 14 | # Why GoBlog? 15 | 16 | We provide a platform for bloggers to write freely from around the world. We provide each user with an unlimited number of blogs, unlimited page views and storage, premium DDOS protection, a CDN, and custom theme support. Our implementation of this platform is almost entirely in Go with server configuration handled by bash. 17 | 18 | # Why Journey? 19 | 20 | We chose Journey as our base because it is a powerful blogging engine fully compatible with Ghost [themes](http://marketplace.ghost.org/). Transitioning over to it is easy. 21 | 22 | # Our Team 23 | [Faraz Fazli](https://www.github.com/farazfazli) - Backend Go Developer 24 | 25 | [Zain Hoda](https://github.com/zainhoda) - Frontend Developer 26 | 27 | [Anne Moroney](https://github.com/AnneTheAgile) - UX Developer 28 | -------------------------------------------------------------------------------- /create.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script written by Faraz 3 | # Automates creating a new Journey Blog with nginx 4 | SITENAME="$1" # Site Name (Without URL) 5 | SITEURL="$2" # Site URL excluding http:// or www. (subdomain for now) 6 | PORT="$3" # <- Port passed in 7 | if [ -z "$SITENAME" ] || [ -z "$SITEURL" ] || [ -z "$PORT" ] 8 | then 9 | echo 'Error, not enough arguments!' 10 | exit 2 11 | fi 12 | SITENAME=journey-$SITENAME 13 | mkdir -p /var/www/$SITENAME 14 | cd /var/www/$SITENAME 15 | cp -R /journey . # Recursively copy preexisting files 16 | cd journey 17 | sed -i -e "s/8084/$PORT/g" config.json 18 | sed -i -e "s/127.0.0.1:$PORT/$SITEURL/g" config.json # Experimental 19 | echo "start on runlevel [2345]" >> /etc/init/$SITENAME.conf 20 | echo "stop on runlevel [!2345]" >> /etc/init/$SITENAME.conf 21 | echo "respawn" >> /etc/init/$SITENAME.conf 22 | echo "console none" >> /etc/init/$SITENAME.conf 23 | echo "exec /var/www/$SITENAME/journey/journey -log=/var/www/$SITENAME/journey/log.txt" >> /etc/init/$SITENAME.conf 24 | cd /etc/nginx/sites-enabled 25 | echo "server {" >> $SITENAME.conf 26 | echo "listen 0.0.0.0:80;" >> $SITENAME.conf 27 | echo "server_name $SITEURL;" >> $SITENAME.conf 28 | echo "access_log /var/log/nginx/$SITENAME.log;" >> $SITENAME.conf 29 | echo "location / {" >> $SITENAME.conf 30 | echo "proxy_pass http://127.0.0.1:$PORT;" >> $SITENAME.conf 31 | echo " }" >> $SITENAME.conf 32 | echo "}" >> $SITENAME.conf 33 | echo "server {" >> $SITENAME.conf 34 | echo "listen 0.0.0.0:80;" >> $SITENAME.conf 35 | echo "server_name www.$SITEURL;" >> $SITENAME.conf 36 | echo "access_log /var/log/nginx/$SITENAME.log;" >> $SITENAME.conf 37 | echo "location / {" >> $SITENAME.conf 38 | echo "proxy_pass http://127.0.0.1:$PORT;" >> $SITENAME.conf 39 | echo " }" >> $SITENAME.conf 40 | echo "}" >> $SITENAME.conf 41 | service $SITENAME start 42 | service nginx restart 43 | service $SITENAME restart # <- required 44 | echo "Created new Journey blog! -> $SITEURL" 45 | echo "---------------------------------------------------" -------------------------------------------------------------------------------- /css/main.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700); 2 | html, 3 | body { 4 | width: 100%; 5 | height: 100%; 6 | } 7 | 8 | body { 9 | font-family: 'Montserrat','Helvetica Neue',Arial,sans-serif; 10 | color: #001A33; 11 | webkit-tap-highlight-color: #222; 12 | top:0; 13 | } 14 | 15 | /* workaround modal-open padding issue */ 16 | body.modal-open { 17 | padding-right:0 !important; 18 | } 19 | 20 | hr { 21 | max-width: 120px; 22 | border-width: 3px; 23 | opacity: 0.08; 24 | margin-top: 25px; 25 | margin-bottom: 25px; 26 | } 27 | 28 | hr.light { 29 | border-color: #fff; 30 | opacity: 1; 31 | } 32 | 33 | hr.primary { 34 | border-color: #007FFF; 35 | opacity: 1; 36 | } 37 | 38 | a { 39 | color: #007FFF; 40 | -webkit-transition: all .35s; 41 | -moz-transition: all .35s; 42 | transition: all .35s; 43 | } 44 | 45 | a:hover, 46 | a:focus { 47 | color: #222; 48 | outline: 0; 49 | } 50 | 51 | p { 52 | font-size: 17px; 53 | line-height: 1.7; 54 | margin-bottom: 20px; 55 | font-family:'Helvetica Neue',Arial,sans-serif; 56 | } 57 | 58 | .text-normal { 59 | font-family:'Helvetica Neue',Arial,sans-serif; 60 | } 61 | 62 | .wide-space { 63 | letter-spacing: 1.6px; 64 | } 65 | 66 | .icon-lg { 67 | font-size: 50px; 68 | line-height: 18px; 69 | } 70 | 71 | .bg-primary { 72 | background-color: #007FFF; 73 | } 74 | 75 | .bg-alt { 76 | background-color: #fff; 77 | } 78 | 79 | .text-faded { 80 | color: rgba(245,245,245,0.7); 81 | } 82 | 83 | .text-dark { 84 | color: #001A33; 85 | } 86 | 87 | .text-light { 88 | color: #fff; 89 | } 90 | 91 | .text-light:hover,.text-light:focus { 92 | color: #eee; 93 | text-decoration:none; 94 | } 95 | 96 | .text-primary { 97 | color: #007FFF; 98 | } 99 | 100 | section { 101 | padding: 70px 0; 102 | } 103 | 104 | aside { 105 | padding: 45px 0; 106 | } 107 | 108 | footer { 109 | padding: 45px; 110 | padding-top: 40px; 111 | background-color: #e0e0e3; 112 | } 113 | 114 | footer h4, footer h6 { 115 | color:#fff; 116 | } 117 | 118 | .navbar-default { 119 | border-color: rgba(35,35,35,.05); 120 | background-color: #fff; 121 | -webkit-transition: all .4s; 122 | -moz-transition: all .4s; 123 | transition: all .4s; 124 | } 125 | 126 | .navbar-brand { 127 | color: #007FFF; 128 | padding: 1px; 129 | line-height: 1.90em; 130 | -webkit-transition: padding .2s ease-in; 131 | -moz-transition: padding .2s ease-in; 132 | transition: padding .2s ease-in; 133 | float:none; 134 | } 135 | 136 | .navbar-brand:hover, 137 | .navbar-brand:focus { 138 | color: #007FFF; 139 | } 140 | 141 | .navbar-default .navbar-toggle:focus, .navbar-default .navbar-toggle:hover { 142 | background-color: #001A33; 143 | } 144 | .navbar-default .navbar-toggle, .navbar-default .navbar-collapse { 145 | border-color: transparent; 146 | } 147 | 148 | .navbar-default .nav > li>a, 149 | .navbar-default .nav>li>a:focus { 150 | font-size: 12px; 151 | color: #001A33; 152 | text-transform: uppercase; 153 | } 154 | 155 | .navbar-default .nav>li>a:hover, 156 | .navbar-default .nav>li>a:focus:hover { 157 | color: #007FFF; 158 | } 159 | 160 | .navbar-default .nav .nav-link.active, 161 | .navbar-default .nav .nav-link.active:focus { 162 | background-color: transparent; 163 | } 164 | 165 | /* responsive nav */ 166 | @media(max-width:48em) { 167 | .navbar-default .navbar-nav>.nav-item { 168 | float: none; 169 | margin-left: .1rem; 170 | } 171 | .navbar-default .navbar-nav { 172 | float:none !important; 173 | } 174 | } 175 | 176 | @media(min-width:48em) { 177 | .navbar-default { 178 | border-color: transparent; 179 | background-color: #fff; 180 | min-height: 60px; 181 | } 182 | 183 | .navbar-brand { 184 | color: #007FFF; 185 | float: left; 186 | padding: 9px; 187 | padding-left: 1px; 188 | } 189 | 190 | .navbar-default .navbar-brand:hover, 191 | .navbar-default .navbar-brand:focus { 192 | color: #218FFE; 193 | } 194 | 195 | .navbar-default .nav > li>a, 196 | .navbar-default .nav>li>a:focus { 197 | color: #007FFF; 198 | padding-left: 5px; 199 | padding-top: 21px; 200 | letter-spacing: 1.1px; 201 | } 202 | 203 | .navbar-default .nav > li>a:hover, 204 | .navbar-default .nav>li>a:focus:hover { 205 | color: #218FFE; 206 | } 207 | 208 | #topNav { 209 | background-color:#fff; 210 | } 211 | 212 | } 213 | 214 | header { 215 | position: relative; 216 | min-height: auto; 217 | text-align: center; 218 | color: #001A33; 219 | width: 100%; 220 | background-color: #fff; 221 | } 222 | 223 | header .header-content { 224 | position: relative; 225 | width: 100%; 226 | padding: 100px 15px; 227 | text-align: center; 228 | z-index: 2; 229 | } 230 | 231 | header .header-content .inner h1 { 232 | margin-top: 0; 233 | margin-bottom: 0; 234 | } 235 | 236 | header .header-content .inner p { 237 | margin-bottom: 50px; 238 | font-size: 16px; 239 | font-weight: 300; 240 | color: #222; 241 | } 242 | 243 | @media(min-width:34em) { 244 | .icon-lg { 245 | font-size: 80px; 246 | } 247 | 248 | header { 249 | min-height: 100%; 250 | } 251 | 252 | header .header-content { 253 | position: absolute; 254 | top: 50%; 255 | padding: 0 50px; 256 | -webkit-transform: translateY(-50%); 257 | -ms-transform: translateY(-50%); 258 | transform: translateY(-50%); 259 | } 260 | 261 | header .header-content .inner { 262 | margin-right: auto; 263 | margin-left: auto; 264 | max-width: 1000px; 265 | } 266 | 267 | header .header-content .inner h1 { 268 | font-size: 53px; 269 | } 270 | 271 | header .header-content .inner p { 272 | margin-right: auto; 273 | margin-left: auto; 274 | max-width: 80%; 275 | font-size: 18px; 276 | } 277 | 278 | section { 279 | min-height: 600px; 280 | padding: 100px 0; 281 | } 282 | 283 | } 284 | 285 | .list-group-item, .card-footer { 286 | background-color:transparent; 287 | } 288 | 289 | textarea { 290 | resize: none; 291 | } 292 | 293 | .call-to-action h2 { 294 | margin: 0 auto 20px; 295 | } 296 | 297 | .btn.btn-primary { 298 | background-color: transparent; 299 | border:1px solid #007FFF; 300 | -webkit-transition: all .35s; 301 | -moz-transition: all .35s; 302 | transition: all .35s; 303 | color:#007FFF; 304 | } 305 | 306 | .btn.btn-primary:hover { 307 | opacity: 0.7; 308 | } 309 | 310 | .btn-primary-outline { 311 | border-color:#007FFF; 312 | color:#007FFF; 313 | } 314 | .btn-primary-outline:hover { 315 | background-color:#007FFF; 316 | } 317 | 318 | .btn-xl { 319 | padding: 15px 30px; 320 | font-size: 20px; 321 | } 322 | 323 | ::-moz-selection { 324 | text-shadow: none; 325 | color: #fff; 326 | background: #222; 327 | } 328 | 329 | ::selection { 330 | text-shadow: none; 331 | color: #fff; 332 | background: #222; 333 | } 334 | 335 | img::selection { 336 | color: #fff; 337 | background: 0 0; 338 | } 339 | 340 | img::-moz-selection { 341 | color: #fff; 342 | background: 0 0; 343 | } -------------------------------------------------------------------------------- /img/anne.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GetGoBlog/GoBlog/30375728a8fc1fe26ae77cf43ee544a419a5ddef/img/anne.jpg -------------------------------------------------------------------------------- /img/faraz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GetGoBlog/GoBlog/30375728a8fc1fe26ae77cf43ee544a419a5ddef/img/faraz.jpg -------------------------------------------------------------------------------- /img/zain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GetGoBlog/GoBlog/30375728a8fc1fe26ae77cf43ee544a419a5ddef/img/zain.jpg -------------------------------------------------------------------------------- /js/jquery_002.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 3 | * 4 | * Uses the built in easing capabilities added In jQuery 1.1 5 | * to offer multiple easing options 6 | * 7 | * TERMS OF USE - EASING EQUATIONS 8 | * 9 | * Open source under the BSD License. 10 | * 11 | * Copyright © 2001 Robert Penner 12 | * All rights reserved. 13 | * 14 | * TERMS OF USE - jQuery Easing 15 | * 16 | * Open source under the BSD License. 17 | * 18 | * Copyright © 2008 George McGinley Smith 19 | * All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without modification, 22 | * are permitted provided that the following conditions are met: 23 | * 24 | * Redistributions of source code must retain the above copyright notice, this list of 25 | * conditions and the following disclaimer. 26 | * Redistributions in binary form must reproduce the above copyright notice, this list 27 | * of conditions and the following disclaimer in the documentation and/or other materials 28 | * provided with the distribution. 29 | * 30 | * Neither the name of the author nor the names of contributors may be used to endorse 31 | * or promote products derived from this software without specific prior written permission. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 34 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 35 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 36 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 37 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 38 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 39 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 40 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 41 | * OF THE POSSIBILITY OF SUCH DAMAGE. 42 | * 43 | */ 44 | jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g 0 && time.Since(t) > timeout { 22 | return ErrTimeout 23 | } 24 | flag := syscall.LOCK_SH 25 | if exclusive { 26 | flag = syscall.LOCK_EX 27 | } 28 | 29 | // Otherwise attempt to obtain an exclusive lock. 30 | err := syscall.Flock(int(f.Fd()), flag|syscall.LOCK_NB) 31 | if err == nil { 32 | return nil 33 | } else if err != syscall.EWOULDBLOCK { 34 | return err 35 | } 36 | 37 | // Wait for a bit and try again. 38 | time.Sleep(50 * time.Millisecond) 39 | } 40 | } 41 | 42 | // funlock releases an advisory lock on a file descriptor. 43 | func funlock(f *os.File) error { 44 | return syscall.Flock(int(f.Fd()), syscall.LOCK_UN) 45 | } 46 | 47 | // mmap memory maps a DB's data file. 48 | func mmap(db *DB, sz int) error { 49 | // Map the data file to memory. 50 | b, err := syscall.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags) 51 | if err != nil { 52 | return err 53 | } 54 | 55 | // Advise the kernel that the mmap is accessed randomly. 56 | if err := madvise(b, syscall.MADV_RANDOM); err != nil { 57 | return fmt.Errorf("madvise: %s", err) 58 | } 59 | 60 | // Save the original byte slice and convert to a byte array pointer. 61 | db.dataref = b 62 | db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0])) 63 | db.datasz = sz 64 | return nil 65 | } 66 | 67 | // munmap unmaps a DB's data file from memory. 68 | func munmap(db *DB) error { 69 | // Ignore the unmap if we have no mapped data. 70 | if db.dataref == nil { 71 | return nil 72 | } 73 | 74 | // Unmap using the original byte slice. 75 | err := syscall.Munmap(db.dataref) 76 | db.dataref = nil 77 | db.data = nil 78 | db.datasz = 0 79 | return err 80 | } 81 | 82 | // NOTE: This function is copied from stdlib because it is not available on darwin. 83 | func madvise(b []byte, advice int) (err error) { 84 | _, _, e1 := syscall.Syscall(syscall.SYS_MADVISE, uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), uintptr(advice)) 85 | if e1 != 0 { 86 | err = e1 87 | } 88 | return 89 | } 90 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_unix_solaris.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "syscall" 7 | "time" 8 | "unsafe" 9 | 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | // flock acquires an advisory lock on a file descriptor. 14 | func flock(f *os.File, exclusive bool, timeout time.Duration) error { 15 | var t time.Time 16 | for { 17 | // If we're beyond our timeout then return an error. 18 | // This can only occur after we've attempted a flock once. 19 | if t.IsZero() { 20 | t = time.Now() 21 | } else if timeout > 0 && time.Since(t) > timeout { 22 | return ErrTimeout 23 | } 24 | var lock syscall.Flock_t 25 | lock.Start = 0 26 | lock.Len = 0 27 | lock.Pid = 0 28 | lock.Whence = 0 29 | lock.Pid = 0 30 | if exclusive { 31 | lock.Type = syscall.F_WRLCK 32 | } else { 33 | lock.Type = syscall.F_RDLCK 34 | } 35 | err := syscall.FcntlFlock(f.Fd(), syscall.F_SETLK, &lock) 36 | if err == nil { 37 | return nil 38 | } else if err != syscall.EAGAIN { 39 | return err 40 | } 41 | 42 | // Wait for a bit and try again. 43 | time.Sleep(50 * time.Millisecond) 44 | } 45 | } 46 | 47 | // funlock releases an advisory lock on a file descriptor. 48 | func funlock(f *os.File) error { 49 | var lock syscall.Flock_t 50 | lock.Start = 0 51 | lock.Len = 0 52 | lock.Type = syscall.F_UNLCK 53 | lock.Whence = 0 54 | return syscall.FcntlFlock(uintptr(f.Fd()), syscall.F_SETLK, &lock) 55 | } 56 | 57 | // mmap memory maps a DB's data file. 58 | func mmap(db *DB, sz int) error { 59 | // Map the data file to memory. 60 | b, err := unix.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags) 61 | if err != nil { 62 | return err 63 | } 64 | 65 | // Advise the kernel that the mmap is accessed randomly. 66 | if err := unix.Madvise(b, syscall.MADV_RANDOM); err != nil { 67 | return fmt.Errorf("madvise: %s", err) 68 | } 69 | 70 | // Save the original byte slice and convert to a byte array pointer. 71 | db.dataref = b 72 | db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0])) 73 | db.datasz = sz 74 | return nil 75 | } 76 | 77 | // munmap unmaps a DB's data file from memory. 78 | func munmap(db *DB) error { 79 | // Ignore the unmap if we have no mapped data. 80 | if db.dataref == nil { 81 | return nil 82 | } 83 | 84 | // Unmap using the original byte slice. 85 | err := unix.Munmap(db.dataref) 86 | db.dataref = nil 87 | db.data = nil 88 | db.datasz = 0 89 | return err 90 | } 91 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/bolt_windows.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "syscall" 7 | "time" 8 | "unsafe" 9 | ) 10 | 11 | // LockFileEx code derived from golang build filemutex_windows.go @ v1.5.1 12 | var ( 13 | modkernel32 = syscall.NewLazyDLL("kernel32.dll") 14 | procLockFileEx = modkernel32.NewProc("LockFileEx") 15 | procUnlockFileEx = modkernel32.NewProc("UnlockFileEx") 16 | ) 17 | 18 | const ( 19 | // see https://msdn.microsoft.com/en-us/library/windows/desktop/aa365203(v=vs.85).aspx 20 | flagLockExclusive = 2 21 | flagLockFailImmediately = 1 22 | 23 | // see https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx 24 | errLockViolation syscall.Errno = 0x21 25 | ) 26 | 27 | func lockFileEx(h syscall.Handle, flags, reserved, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) { 28 | r, _, err := procLockFileEx.Call(uintptr(h), uintptr(flags), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol))) 29 | if r == 0 { 30 | return err 31 | } 32 | return nil 33 | } 34 | 35 | func unlockFileEx(h syscall.Handle, reserved, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) { 36 | r, _, err := procUnlockFileEx.Call(uintptr(h), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol)), 0) 37 | if r == 0 { 38 | return err 39 | } 40 | return nil 41 | } 42 | 43 | // fdatasync flushes written data to a file descriptor. 44 | func fdatasync(db *DB) error { 45 | return db.file.Sync() 46 | } 47 | 48 | // flock acquires an advisory lock on a file descriptor. 49 | func flock(f *os.File, exclusive bool, timeout time.Duration) error { 50 | var t time.Time 51 | for { 52 | // If we're beyond our timeout then return an error. 53 | // This can only occur after we've attempted a flock once. 54 | if t.IsZero() { 55 | t = time.Now() 56 | } else if timeout > 0 && time.Since(t) > timeout { 57 | return ErrTimeout 58 | } 59 | 60 | var flag uint32 = flagLockFailImmediately 61 | if exclusive { 62 | flag |= flagLockExclusive 63 | } 64 | 65 | err := lockFileEx(syscall.Handle(f.Fd()), flag, 0, 1, 0, &syscall.Overlapped{}) 66 | if err == nil { 67 | return nil 68 | } else if err != errLockViolation { 69 | return err 70 | } 71 | 72 | // Wait for a bit and try again. 73 | time.Sleep(50 * time.Millisecond) 74 | } 75 | } 76 | 77 | // funlock releases an advisory lock on a file descriptor. 78 | func funlock(f *os.File) error { 79 | return unlockFileEx(syscall.Handle(f.Fd()), 0, 1, 0, &syscall.Overlapped{}) 80 | } 81 | 82 | // mmap memory maps a DB's data file. 83 | // Based on: https://github.com/edsrzf/mmap-go 84 | func mmap(db *DB, sz int) error { 85 | if !db.readOnly { 86 | // Truncate the database to the size of the mmap. 87 | if err := db.file.Truncate(int64(sz)); err != nil { 88 | return fmt.Errorf("truncate: %s", err) 89 | } 90 | } 91 | 92 | // Open a file mapping handle. 93 | sizelo := uint32(sz >> 32) 94 | sizehi := uint32(sz) & 0xffffffff 95 | h, errno := syscall.CreateFileMapping(syscall.Handle(db.file.Fd()), nil, syscall.PAGE_READONLY, sizelo, sizehi, nil) 96 | if h == 0 { 97 | return os.NewSyscallError("CreateFileMapping", errno) 98 | } 99 | 100 | // Create the memory map. 101 | addr, errno := syscall.MapViewOfFile(h, syscall.FILE_MAP_READ, 0, 0, uintptr(sz)) 102 | if addr == 0 { 103 | return os.NewSyscallError("MapViewOfFile", errno) 104 | } 105 | 106 | // Close mapping handle. 107 | if err := syscall.CloseHandle(syscall.Handle(h)); err != nil { 108 | return os.NewSyscallError("CloseHandle", err) 109 | } 110 | 111 | // Convert to a byte array. 112 | db.data = ((*[maxMapSize]byte)(unsafe.Pointer(addr))) 113 | db.datasz = sz 114 | 115 | return nil 116 | } 117 | 118 | // munmap unmaps a pointer from a file. 119 | // Based on: https://github.com/edsrzf/mmap-go 120 | func munmap(db *DB) error { 121 | if db.data == nil { 122 | return nil 123 | } 124 | 125 | addr := (uintptr)(unsafe.Pointer(&db.data[0])) 126 | if err := syscall.UnmapViewOfFile(addr); err != nil { 127 | return os.NewSyscallError("UnmapViewOfFile", err) 128 | } 129 | return nil 130 | } 131 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/boltsync_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9,!linux,!openbsd 2 | 3 | package bolt 4 | 5 | // fdatasync flushes written data to a file descriptor. 6 | func fdatasync(db *DB) error { 7 | return db.file.Sync() 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package bolt implements a low-level key/value store in pure Go. It supports 3 | fully serializable transactions, ACID semantics, and lock-free MVCC with 4 | multiple readers and a single writer. Bolt can be used for projects that 5 | want a simple data store without the need to add large dependencies such as 6 | Postgres or MySQL. 7 | 8 | Bolt is a single-level, zero-copy, B+tree data store. This means that Bolt is 9 | optimized for fast read access and does not require recovery in the event of a 10 | system crash. Transactions which have not finished committing will simply be 11 | rolled back in the event of a crash. 12 | 13 | The design of Bolt is based on Howard Chu's LMDB database project. 14 | 15 | Bolt currently works on Windows, Mac OS X, and Linux. 16 | 17 | 18 | Basics 19 | 20 | There are only a few types in Bolt: DB, Bucket, Tx, and Cursor. The DB is 21 | a collection of buckets and is represented by a single file on disk. A bucket is 22 | a collection of unique keys that are associated with values. 23 | 24 | Transactions provide either read-only or read-write access to the database. 25 | Read-only transactions can retrieve key/value pairs and can use Cursors to 26 | iterate over the dataset sequentially. Read-write transactions can create and 27 | delete buckets and can insert and remove keys. Only one read-write transaction 28 | is allowed at a time. 29 | 30 | 31 | Caveats 32 | 33 | The database uses a read-only, memory-mapped data file to ensure that 34 | applications cannot corrupt the database, however, this means that keys and 35 | values returned from Bolt cannot be changed. Writing to a read-only byte slice 36 | will cause Go to panic. 37 | 38 | Keys and values retrieved from the database are only valid for the life of 39 | the transaction. When used outside the transaction, these byte slices can 40 | point to different data or can point to invalid memory which will cause a panic. 41 | 42 | 43 | */ 44 | package bolt 45 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/errors.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import "errors" 4 | 5 | // These errors can be returned when opening or calling methods on a DB. 6 | var ( 7 | // ErrDatabaseNotOpen is returned when a DB instance is accessed before it 8 | // is opened or after it is closed. 9 | ErrDatabaseNotOpen = errors.New("database not open") 10 | 11 | // ErrDatabaseOpen is returned when opening a database that is 12 | // already open. 13 | ErrDatabaseOpen = errors.New("database already open") 14 | 15 | // ErrInvalid is returned when a data file is not a Bolt-formatted database. 16 | ErrInvalid = errors.New("invalid database") 17 | 18 | // ErrVersionMismatch is returned when the data file was created with a 19 | // different version of Bolt. 20 | ErrVersionMismatch = errors.New("version mismatch") 21 | 22 | // ErrChecksum is returned when either meta page checksum does not match. 23 | ErrChecksum = errors.New("checksum error") 24 | 25 | // ErrTimeout is returned when a database cannot obtain an exclusive lock 26 | // on the data file after the timeout passed to Open(). 27 | ErrTimeout = errors.New("timeout") 28 | ) 29 | 30 | // These errors can occur when beginning or committing a Tx. 31 | var ( 32 | // ErrTxNotWritable is returned when performing a write operation on a 33 | // read-only transaction. 34 | ErrTxNotWritable = errors.New("tx not writable") 35 | 36 | // ErrTxClosed is returned when committing or rolling back a transaction 37 | // that has already been committed or rolled back. 38 | ErrTxClosed = errors.New("tx closed") 39 | 40 | // ErrDatabaseReadOnly is returned when a mutating transaction is started on a 41 | // read-only database. 42 | ErrDatabaseReadOnly = errors.New("database is in read-only mode") 43 | ) 44 | 45 | // These errors can occur when putting or deleting a value or a bucket. 46 | var ( 47 | // ErrBucketNotFound is returned when trying to access a bucket that has 48 | // not been created yet. 49 | ErrBucketNotFound = errors.New("bucket not found") 50 | 51 | // ErrBucketExists is returned when creating a bucket that already exists. 52 | ErrBucketExists = errors.New("bucket already exists") 53 | 54 | // ErrBucketNameRequired is returned when creating a bucket with a blank name. 55 | ErrBucketNameRequired = errors.New("bucket name required") 56 | 57 | // ErrKeyRequired is returned when inserting a zero-length key. 58 | ErrKeyRequired = errors.New("key required") 59 | 60 | // ErrKeyTooLarge is returned when inserting a key that is larger than MaxKeySize. 61 | ErrKeyTooLarge = errors.New("key too large") 62 | 63 | // ErrValueTooLarge is returned when inserting a value that is larger than MaxValueSize. 64 | ErrValueTooLarge = errors.New("value too large") 65 | 66 | // ErrIncompatibleValue is returned when trying create or delete a bucket 67 | // on an existing non-bucket key or when trying to create or delete a 68 | // non-bucket key on an existing bucket key. 69 | ErrIncompatibleValue = errors.New("incompatible value") 70 | ) 71 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/freelist.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "fmt" 5 | "sort" 6 | "unsafe" 7 | ) 8 | 9 | // freelist represents a list of all pages that are available for allocation. 10 | // It also tracks pages that have been freed but are still in use by open transactions. 11 | type freelist struct { 12 | ids []pgid // all free and available free page ids. 13 | pending map[txid][]pgid // mapping of soon-to-be free page ids by tx. 14 | cache map[pgid]bool // fast lookup of all free and pending page ids. 15 | } 16 | 17 | // newFreelist returns an empty, initialized freelist. 18 | func newFreelist() *freelist { 19 | return &freelist{ 20 | pending: make(map[txid][]pgid), 21 | cache: make(map[pgid]bool), 22 | } 23 | } 24 | 25 | // size returns the size of the page after serialization. 26 | func (f *freelist) size() int { 27 | return pageHeaderSize + (int(unsafe.Sizeof(pgid(0))) * f.count()) 28 | } 29 | 30 | // count returns count of pages on the freelist 31 | func (f *freelist) count() int { 32 | return f.free_count() + f.pending_count() 33 | } 34 | 35 | // free_count returns count of free pages 36 | func (f *freelist) free_count() int { 37 | return len(f.ids) 38 | } 39 | 40 | // pending_count returns count of pending pages 41 | func (f *freelist) pending_count() int { 42 | var count int 43 | for _, list := range f.pending { 44 | count += len(list) 45 | } 46 | return count 47 | } 48 | 49 | // all returns a list of all free ids and all pending ids in one sorted list. 50 | func (f *freelist) all() []pgid { 51 | m := make(pgids, 0) 52 | 53 | for _, list := range f.pending { 54 | m = append(m, list...) 55 | } 56 | 57 | sort.Sort(m) 58 | return pgids(f.ids).merge(m) 59 | } 60 | 61 | // allocate returns the starting page id of a contiguous list of pages of a given size. 62 | // If a contiguous block cannot be found then 0 is returned. 63 | func (f *freelist) allocate(n int) pgid { 64 | if len(f.ids) == 0 { 65 | return 0 66 | } 67 | 68 | var initial, previd pgid 69 | for i, id := range f.ids { 70 | if id <= 1 { 71 | panic(fmt.Sprintf("invalid page allocation: %d", id)) 72 | } 73 | 74 | // Reset initial page if this is not contiguous. 75 | if previd == 0 || id-previd != 1 { 76 | initial = id 77 | } 78 | 79 | // If we found a contiguous block then remove it and return it. 80 | if (id-initial)+1 == pgid(n) { 81 | // If we're allocating off the beginning then take the fast path 82 | // and just adjust the existing slice. This will use extra memory 83 | // temporarily but the append() in free() will realloc the slice 84 | // as is necessary. 85 | if (i + 1) == n { 86 | f.ids = f.ids[i+1:] 87 | } else { 88 | copy(f.ids[i-n+1:], f.ids[i+1:]) 89 | f.ids = f.ids[:len(f.ids)-n] 90 | } 91 | 92 | // Remove from the free cache. 93 | for i := pgid(0); i < pgid(n); i++ { 94 | delete(f.cache, initial+i) 95 | } 96 | 97 | return initial 98 | } 99 | 100 | previd = id 101 | } 102 | return 0 103 | } 104 | 105 | // free releases a page and its overflow for a given transaction id. 106 | // If the page is already free then a panic will occur. 107 | func (f *freelist) free(txid txid, p *page) { 108 | if p.id <= 1 { 109 | panic(fmt.Sprintf("cannot free page 0 or 1: %d", p.id)) 110 | } 111 | 112 | // Free page and all its overflow pages. 113 | var ids = f.pending[txid] 114 | for id := p.id; id <= p.id+pgid(p.overflow); id++ { 115 | // Verify that page is not already free. 116 | if f.cache[id] { 117 | panic(fmt.Sprintf("page %d already freed", id)) 118 | } 119 | 120 | // Add to the freelist and cache. 121 | ids = append(ids, id) 122 | f.cache[id] = true 123 | } 124 | f.pending[txid] = ids 125 | } 126 | 127 | // release moves all page ids for a transaction id (or older) to the freelist. 128 | func (f *freelist) release(txid txid) { 129 | m := make(pgids, 0) 130 | for tid, ids := range f.pending { 131 | if tid <= txid { 132 | // Move transaction's pending pages to the available freelist. 133 | // Don't remove from the cache since the page is still free. 134 | m = append(m, ids...) 135 | delete(f.pending, tid) 136 | } 137 | } 138 | sort.Sort(m) 139 | f.ids = pgids(f.ids).merge(m) 140 | } 141 | 142 | // rollback removes the pages from a given pending tx. 143 | func (f *freelist) rollback(txid txid) { 144 | // Remove page ids from cache. 145 | for _, id := range f.pending[txid] { 146 | delete(f.cache, id) 147 | } 148 | 149 | // Remove pages from pending list. 150 | delete(f.pending, txid) 151 | } 152 | 153 | // freed returns whether a given page is in the free list. 154 | func (f *freelist) freed(pgid pgid) bool { 155 | return f.cache[pgid] 156 | } 157 | 158 | // read initializes the freelist from a freelist page. 159 | func (f *freelist) read(p *page) { 160 | // If the page.count is at the max uint16 value (64k) then it's considered 161 | // an overflow and the size of the freelist is stored as the first element. 162 | idx, count := 0, int(p.count) 163 | if count == 0xFFFF { 164 | idx = 1 165 | count = int(((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[0]) 166 | } 167 | 168 | // Copy the list of page ids from the freelist. 169 | ids := ((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[idx:count] 170 | f.ids = make([]pgid, len(ids)) 171 | copy(f.ids, ids) 172 | 173 | // Make sure they're sorted. 174 | sort.Sort(pgids(f.ids)) 175 | 176 | // Rebuild the page cache. 177 | f.reindex() 178 | } 179 | 180 | // write writes the page ids onto a freelist page. All free and pending ids are 181 | // saved to disk since in the event of a program crash, all pending ids will 182 | // become free. 183 | func (f *freelist) write(p *page) error { 184 | // Combine the old free pgids and pgids waiting on an open transaction. 185 | ids := f.all() 186 | 187 | // Update the header flag. 188 | p.flags |= freelistPageFlag 189 | 190 | // The page.count can only hold up to 64k elements so if we overflow that 191 | // number then we handle it by putting the size in the first element. 192 | if len(ids) < 0xFFFF { 193 | p.count = uint16(len(ids)) 194 | copy(((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[:], ids) 195 | } else { 196 | p.count = 0xFFFF 197 | ((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[0] = pgid(len(ids)) 198 | copy(((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[1:], ids) 199 | } 200 | 201 | return nil 202 | } 203 | 204 | // reload reads the freelist from a page and filters out pending items. 205 | func (f *freelist) reload(p *page) { 206 | f.read(p) 207 | 208 | // Build a cache of only pending pages. 209 | pcache := make(map[pgid]bool) 210 | for _, pendingIDs := range f.pending { 211 | for _, pendingID := range pendingIDs { 212 | pcache[pendingID] = true 213 | } 214 | } 215 | 216 | // Check each page in the freelist and build a new available freelist 217 | // with any pages not in the pending lists. 218 | var a []pgid 219 | for _, id := range f.ids { 220 | if !pcache[id] { 221 | a = append(a, id) 222 | } 223 | } 224 | f.ids = a 225 | 226 | // Once the available list is rebuilt then rebuild the free cache so that 227 | // it includes the available and pending free pages. 228 | f.reindex() 229 | } 230 | 231 | // reindex rebuilds the free cache based on available and pending free lists. 232 | func (f *freelist) reindex() { 233 | f.cache = make(map[pgid]bool) 234 | for _, id := range f.ids { 235 | f.cache[id] = true 236 | } 237 | for _, pendingIDs := range f.pending { 238 | for _, pendingID := range pendingIDs { 239 | f.cache[pendingID] = true 240 | } 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /vendor/github.com/boltdb/bolt/page.go: -------------------------------------------------------------------------------- 1 | package bolt 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "sort" 7 | "unsafe" 8 | ) 9 | 10 | const pageHeaderSize = int(unsafe.Offsetof(((*page)(nil)).ptr)) 11 | 12 | const minKeysPerPage = 2 13 | 14 | const branchPageElementSize = int(unsafe.Sizeof(branchPageElement{})) 15 | const leafPageElementSize = int(unsafe.Sizeof(leafPageElement{})) 16 | 17 | const ( 18 | branchPageFlag = 0x01 19 | leafPageFlag = 0x02 20 | metaPageFlag = 0x04 21 | freelistPageFlag = 0x10 22 | ) 23 | 24 | const ( 25 | bucketLeafFlag = 0x01 26 | ) 27 | 28 | type pgid uint64 29 | 30 | type page struct { 31 | id pgid 32 | flags uint16 33 | count uint16 34 | overflow uint32 35 | ptr uintptr 36 | } 37 | 38 | // typ returns a human readable page type string used for debugging. 39 | func (p *page) typ() string { 40 | if (p.flags & branchPageFlag) != 0 { 41 | return "branch" 42 | } else if (p.flags & leafPageFlag) != 0 { 43 | return "leaf" 44 | } else if (p.flags & metaPageFlag) != 0 { 45 | return "meta" 46 | } else if (p.flags & freelistPageFlag) != 0 { 47 | return "freelist" 48 | } 49 | return fmt.Sprintf("unknown<%02x>", p.flags) 50 | } 51 | 52 | // meta returns a pointer to the metadata section of the page. 53 | func (p *page) meta() *meta { 54 | return (*meta)(unsafe.Pointer(&p.ptr)) 55 | } 56 | 57 | // leafPageElement retrieves the leaf node by index 58 | func (p *page) leafPageElement(index uint16) *leafPageElement { 59 | n := &((*[0x7FFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[index] 60 | return n 61 | } 62 | 63 | // leafPageElements retrieves a list of leaf nodes. 64 | func (p *page) leafPageElements() []leafPageElement { 65 | return ((*[0x7FFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[:] 66 | } 67 | 68 | // branchPageElement retrieves the branch node by index 69 | func (p *page) branchPageElement(index uint16) *branchPageElement { 70 | return &((*[0x7FFFFFF]branchPageElement)(unsafe.Pointer(&p.ptr)))[index] 71 | } 72 | 73 | // branchPageElements retrieves a list of branch nodes. 74 | func (p *page) branchPageElements() []branchPageElement { 75 | return ((*[0x7FFFFFF]branchPageElement)(unsafe.Pointer(&p.ptr)))[:] 76 | } 77 | 78 | // dump writes n bytes of the page to STDERR as hex output. 79 | func (p *page) hexdump(n int) { 80 | buf := (*[maxAllocSize]byte)(unsafe.Pointer(p))[:n] 81 | fmt.Fprintf(os.Stderr, "%x\n", buf) 82 | } 83 | 84 | type pages []*page 85 | 86 | func (s pages) Len() int { return len(s) } 87 | func (s pages) Swap(i, j int) { s[i], s[j] = s[j], s[i] } 88 | func (s pages) Less(i, j int) bool { return s[i].id < s[j].id } 89 | 90 | // branchPageElement represents a node on a branch page. 91 | type branchPageElement struct { 92 | pos uint32 93 | ksize uint32 94 | pgid pgid 95 | } 96 | 97 | // key returns a byte slice of the node key. 98 | func (n *branchPageElement) key() []byte { 99 | buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) 100 | return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos]))[:n.ksize] 101 | } 102 | 103 | // leafPageElement represents a node on a leaf page. 104 | type leafPageElement struct { 105 | flags uint32 106 | pos uint32 107 | ksize uint32 108 | vsize uint32 109 | } 110 | 111 | // key returns a byte slice of the node key. 112 | func (n *leafPageElement) key() []byte { 113 | buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) 114 | return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos]))[:n.ksize] 115 | } 116 | 117 | // value returns a byte slice of the node value. 118 | func (n *leafPageElement) value() []byte { 119 | buf := (*[maxAllocSize]byte)(unsafe.Pointer(n)) 120 | return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos+n.ksize]))[:n.vsize] 121 | } 122 | 123 | // PageInfo represents human readable information about a page. 124 | type PageInfo struct { 125 | ID int 126 | Type string 127 | Count int 128 | OverflowCount int 129 | } 130 | 131 | type pgids []pgid 132 | 133 | func (s pgids) Len() int { return len(s) } 134 | func (s pgids) Swap(i, j int) { s[i], s[j] = s[j], s[i] } 135 | func (s pgids) Less(i, j int) bool { return s[i] < s[j] } 136 | 137 | // merge returns the sorted union of a and b. 138 | func (a pgids) merge(b pgids) pgids { 139 | // Return the opposite slice if one is nil. 140 | if len(a) == 0 { 141 | return b 142 | } else if len(b) == 0 { 143 | return a 144 | } 145 | 146 | // Create a list to hold all elements from both lists. 147 | merged := make(pgids, 0, len(a)+len(b)) 148 | 149 | // Assign lead to the slice with a lower starting value, follow to the higher value. 150 | lead, follow := a, b 151 | if b[0] < a[0] { 152 | lead, follow = b, a 153 | } 154 | 155 | // Continue while there are elements in the lead. 156 | for len(lead) > 0 { 157 | // Merge largest prefix of lead that is ahead of follow[0]. 158 | n := sort.Search(len(lead), func(i int) bool { return lead[i] > follow[0] }) 159 | merged = append(merged, lead[:n]...) 160 | if n >= len(lead) { 161 | break 162 | } 163 | 164 | // Swap lead and follow. 165 | lead, follow = follow, lead[n:] 166 | } 167 | 168 | // Append what's left in follow. 169 | merged = append(merged, follow...) 170 | 171 | return merged 172 | } 173 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Rodrigo Moraes. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/README.md: -------------------------------------------------------------------------------- 1 | context 2 | ======= 3 | [![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context) 4 | 5 | gorilla/context is a general purpose registry for global request variables. 6 | 7 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/context 8 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/context.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Gorilla Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package context 6 | 7 | import ( 8 | "net/http" 9 | "sync" 10 | "time" 11 | ) 12 | 13 | var ( 14 | mutex sync.RWMutex 15 | data = make(map[*http.Request]map[interface{}]interface{}) 16 | datat = make(map[*http.Request]int64) 17 | ) 18 | 19 | // Set stores a value for a given key in a given request. 20 | func Set(r *http.Request, key, val interface{}) { 21 | mutex.Lock() 22 | if data[r] == nil { 23 | data[r] = make(map[interface{}]interface{}) 24 | datat[r] = time.Now().Unix() 25 | } 26 | data[r][key] = val 27 | mutex.Unlock() 28 | } 29 | 30 | // Get returns a value stored for a given key in a given request. 31 | func Get(r *http.Request, key interface{}) interface{} { 32 | mutex.RLock() 33 | if ctx := data[r]; ctx != nil { 34 | value := ctx[key] 35 | mutex.RUnlock() 36 | return value 37 | } 38 | mutex.RUnlock() 39 | return nil 40 | } 41 | 42 | // GetOk returns stored value and presence state like multi-value return of map access. 43 | func GetOk(r *http.Request, key interface{}) (interface{}, bool) { 44 | mutex.RLock() 45 | if _, ok := data[r]; ok { 46 | value, ok := data[r][key] 47 | mutex.RUnlock() 48 | return value, ok 49 | } 50 | mutex.RUnlock() 51 | return nil, false 52 | } 53 | 54 | // GetAll returns all stored values for the request as a map. Nil is returned for invalid requests. 55 | func GetAll(r *http.Request) map[interface{}]interface{} { 56 | mutex.RLock() 57 | if context, ok := data[r]; ok { 58 | result := make(map[interface{}]interface{}, len(context)) 59 | for k, v := range context { 60 | result[k] = v 61 | } 62 | mutex.RUnlock() 63 | return result 64 | } 65 | mutex.RUnlock() 66 | return nil 67 | } 68 | 69 | // GetAllOk returns all stored values for the request as a map and a boolean value that indicates if 70 | // the request was registered. 71 | func GetAllOk(r *http.Request) (map[interface{}]interface{}, bool) { 72 | mutex.RLock() 73 | context, ok := data[r] 74 | result := make(map[interface{}]interface{}, len(context)) 75 | for k, v := range context { 76 | result[k] = v 77 | } 78 | mutex.RUnlock() 79 | return result, ok 80 | } 81 | 82 | // Delete removes a value stored for a given key in a given request. 83 | func Delete(r *http.Request, key interface{}) { 84 | mutex.Lock() 85 | if data[r] != nil { 86 | delete(data[r], key) 87 | } 88 | mutex.Unlock() 89 | } 90 | 91 | // Clear removes all values stored for a given request. 92 | // 93 | // This is usually called by a handler wrapper to clean up request 94 | // variables at the end of a request lifetime. See ClearHandler(). 95 | func Clear(r *http.Request) { 96 | mutex.Lock() 97 | clear(r) 98 | mutex.Unlock() 99 | } 100 | 101 | // clear is Clear without the lock. 102 | func clear(r *http.Request) { 103 | delete(data, r) 104 | delete(datat, r) 105 | } 106 | 107 | // Purge removes request data stored for longer than maxAge, in seconds. 108 | // It returns the amount of requests removed. 109 | // 110 | // If maxAge <= 0, all request data is removed. 111 | // 112 | // This is only used for sanity check: in case context cleaning was not 113 | // properly set some request data can be kept forever, consuming an increasing 114 | // amount of memory. In case this is detected, Purge() must be called 115 | // periodically until the problem is fixed. 116 | func Purge(maxAge int) int { 117 | mutex.Lock() 118 | count := 0 119 | if maxAge <= 0 { 120 | count = len(data) 121 | data = make(map[*http.Request]map[interface{}]interface{}) 122 | datat = make(map[*http.Request]int64) 123 | } else { 124 | min := time.Now().Unix() - int64(maxAge) 125 | for r := range data { 126 | if datat[r] < min { 127 | clear(r) 128 | count++ 129 | } 130 | } 131 | } 132 | mutex.Unlock() 133 | return count 134 | } 135 | 136 | // ClearHandler wraps an http.Handler and clears request values at the end 137 | // of a request lifetime. 138 | func ClearHandler(h http.Handler) http.Handler { 139 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 140 | defer Clear(r) 141 | h.ServeHTTP(w, r) 142 | }) 143 | } 144 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Gorilla Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package context stores values shared during a request lifetime. 7 | 8 | For example, a router can set variables extracted from the URL and later 9 | application handlers can access those values, or it can be used to store 10 | sessions values to be saved at the end of a request. There are several 11 | others common uses. 12 | 13 | The idea was posted by Brad Fitzpatrick to the go-nuts mailing list: 14 | 15 | http://groups.google.com/group/golang-nuts/msg/e2d679d303aa5d53 16 | 17 | Here's the basic usage: first define the keys that you will need. The key 18 | type is interface{} so a key can be of any type that supports equality. 19 | Here we define a key using a custom int type to avoid name collisions: 20 | 21 | package foo 22 | 23 | import ( 24 | "github.com/gorilla/context" 25 | ) 26 | 27 | type key int 28 | 29 | const MyKey key = 0 30 | 31 | Then set a variable. Variables are bound to an http.Request object, so you 32 | need a request instance to set a value: 33 | 34 | context.Set(r, MyKey, "bar") 35 | 36 | The application can later access the variable using the same key you provided: 37 | 38 | func MyHandler(w http.ResponseWriter, r *http.Request) { 39 | // val is "bar". 40 | val := context.Get(r, foo.MyKey) 41 | 42 | // returns ("bar", true) 43 | val, ok := context.GetOk(r, foo.MyKey) 44 | // ... 45 | } 46 | 47 | And that's all about the basic usage. We discuss some other ideas below. 48 | 49 | Any type can be stored in the context. To enforce a given type, make the key 50 | private and wrap Get() and Set() to accept and return values of a specific 51 | type: 52 | 53 | type key int 54 | 55 | const mykey key = 0 56 | 57 | // GetMyKey returns a value for this package from the request values. 58 | func GetMyKey(r *http.Request) SomeType { 59 | if rv := context.Get(r, mykey); rv != nil { 60 | return rv.(SomeType) 61 | } 62 | return nil 63 | } 64 | 65 | // SetMyKey sets a value for this package in the request values. 66 | func SetMyKey(r *http.Request, val SomeType) { 67 | context.Set(r, mykey, val) 68 | } 69 | 70 | Variables must be cleared at the end of a request, to remove all values 71 | that were stored. This can be done in an http.Handler, after a request was 72 | served. Just call Clear() passing the request: 73 | 74 | context.Clear(r) 75 | 76 | ...or use ClearHandler(), which conveniently wraps an http.Handler to clear 77 | variables at the end of a request lifetime. 78 | 79 | The Routers from the packages gorilla/mux and gorilla/pat call Clear() 80 | so if you are using either of them you don't need to clear the context manually. 81 | */ 82 | package context 83 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Rodrigo Moraes. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Gorilla Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package gorilla/mux implements a request router and dispatcher. 7 | 8 | The name mux stands for "HTTP request multiplexer". Like the standard 9 | http.ServeMux, mux.Router matches incoming requests against a list of 10 | registered routes and calls a handler for the route that matches the URL 11 | or other conditions. The main features are: 12 | 13 | * Requests can be matched based on URL host, path, path prefix, schemes, 14 | header and query values, HTTP methods or using custom matchers. 15 | * URL hosts and paths can have variables with an optional regular 16 | expression. 17 | * Registered URLs can be built, or "reversed", which helps maintaining 18 | references to resources. 19 | * Routes can be used as subrouters: nested routes are only tested if the 20 | parent route matches. This is useful to define groups of routes that 21 | share common conditions like a host, a path prefix or other repeated 22 | attributes. As a bonus, this optimizes request matching. 23 | * It implements the http.Handler interface so it is compatible with the 24 | standard http.ServeMux. 25 | 26 | Let's start registering a couple of URL paths and handlers: 27 | 28 | func main() { 29 | r := mux.NewRouter() 30 | r.HandleFunc("/", HomeHandler) 31 | r.HandleFunc("/products", ProductsHandler) 32 | r.HandleFunc("/articles", ArticlesHandler) 33 | http.Handle("/", r) 34 | } 35 | 36 | Here we register three routes mapping URL paths to handlers. This is 37 | equivalent to how http.HandleFunc() works: if an incoming request URL matches 38 | one of the paths, the corresponding handler is called passing 39 | (http.ResponseWriter, *http.Request) as parameters. 40 | 41 | Paths can have variables. They are defined using the format {name} or 42 | {name:pattern}. If a regular expression pattern is not defined, the matched 43 | variable will be anything until the next slash. For example: 44 | 45 | r := mux.NewRouter() 46 | r.HandleFunc("/products/{key}", ProductHandler) 47 | r.HandleFunc("/articles/{category}/", ArticlesCategoryHandler) 48 | r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler) 49 | 50 | The names are used to create a map of route variables which can be retrieved 51 | calling mux.Vars(): 52 | 53 | vars := mux.Vars(request) 54 | category := vars["category"] 55 | 56 | And this is all you need to know about the basic usage. More advanced options 57 | are explained below. 58 | 59 | Routes can also be restricted to a domain or subdomain. Just define a host 60 | pattern to be matched. They can also have variables: 61 | 62 | r := mux.NewRouter() 63 | // Only matches if domain is "www.example.com". 64 | r.Host("www.example.com") 65 | // Matches a dynamic subdomain. 66 | r.Host("{subdomain:[a-z]+}.domain.com") 67 | 68 | There are several other matchers that can be added. To match path prefixes: 69 | 70 | r.PathPrefix("/products/") 71 | 72 | ...or HTTP methods: 73 | 74 | r.Methods("GET", "POST") 75 | 76 | ...or URL schemes: 77 | 78 | r.Schemes("https") 79 | 80 | ...or header values: 81 | 82 | r.Headers("X-Requested-With", "XMLHttpRequest") 83 | 84 | ...or query values: 85 | 86 | r.Queries("key", "value") 87 | 88 | ...or to use a custom matcher function: 89 | 90 | r.MatcherFunc(func(r *http.Request, rm *RouteMatch) bool { 91 | return r.ProtoMajor == 0 92 | }) 93 | 94 | ...and finally, it is possible to combine several matchers in a single route: 95 | 96 | r.HandleFunc("/products", ProductsHandler). 97 | Host("www.example.com"). 98 | Methods("GET"). 99 | Schemes("http") 100 | 101 | Setting the same matching conditions again and again can be boring, so we have 102 | a way to group several routes that share the same requirements. 103 | We call it "subrouting". 104 | 105 | For example, let's say we have several URLs that should only match when the 106 | host is "www.example.com". Create a route for that host and get a "subrouter" 107 | from it: 108 | 109 | r := mux.NewRouter() 110 | s := r.Host("www.example.com").Subrouter() 111 | 112 | Then register routes in the subrouter: 113 | 114 | s.HandleFunc("/products/", ProductsHandler) 115 | s.HandleFunc("/products/{key}", ProductHandler) 116 | s.HandleFunc("/articles/{category}/{id:[0-9]+}"), ArticleHandler) 117 | 118 | The three URL paths we registered above will only be tested if the domain is 119 | "www.example.com", because the subrouter is tested first. This is not 120 | only convenient, but also optimizes request matching. You can create 121 | subrouters combining any attribute matchers accepted by a route. 122 | 123 | Subrouters can be used to create domain or path "namespaces": you define 124 | subrouters in a central place and then parts of the app can register its 125 | paths relatively to a given subrouter. 126 | 127 | There's one more thing about subroutes. When a subrouter has a path prefix, 128 | the inner routes use it as base for their paths: 129 | 130 | r := mux.NewRouter() 131 | s := r.PathPrefix("/products").Subrouter() 132 | // "/products/" 133 | s.HandleFunc("/", ProductsHandler) 134 | // "/products/{key}/" 135 | s.HandleFunc("/{key}/", ProductHandler) 136 | // "/products/{key}/details" 137 | s.HandleFunc("/{key}/details", ProductDetailsHandler) 138 | 139 | Now let's see how to build registered URLs. 140 | 141 | Routes can be named. All routes that define a name can have their URLs built, 142 | or "reversed". We define a name calling Name() on a route. For example: 143 | 144 | r := mux.NewRouter() 145 | r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler). 146 | Name("article") 147 | 148 | To build a URL, get the route and call the URL() method, passing a sequence of 149 | key/value pairs for the route variables. For the previous route, we would do: 150 | 151 | url, err := r.Get("article").URL("category", "technology", "id", "42") 152 | 153 | ...and the result will be a url.URL with the following path: 154 | 155 | "/articles/technology/42" 156 | 157 | This also works for host variables: 158 | 159 | r := mux.NewRouter() 160 | r.Host("{subdomain}.domain.com"). 161 | Path("/articles/{category}/{id:[0-9]+}"). 162 | HandlerFunc(ArticleHandler). 163 | Name("article") 164 | 165 | // url.String() will be "http://news.domain.com/articles/technology/42" 166 | url, err := r.Get("article").URL("subdomain", "news", 167 | "category", "technology", 168 | "id", "42") 169 | 170 | All variables defined in the route are required, and their values must 171 | conform to the corresponding patterns. These requirements guarantee that a 172 | generated URL will always match a registered route -- the only exception is 173 | for explicitly defined "build-only" routes which never match. 174 | 175 | Regex support also exists for matching Headers within a route. For example, we could do: 176 | 177 | r.HeadersRegexp("Content-Type", "application/(text|json)") 178 | 179 | ...and the route will match both requests with a Content-Type of `application/json` as well as 180 | `application/text` 181 | 182 | There's also a way to build only the URL host or path for a route: 183 | use the methods URLHost() or URLPath() instead. For the previous route, 184 | we would do: 185 | 186 | // "http://news.domain.com/" 187 | host, err := r.Get("article").URLHost("subdomain", "news") 188 | 189 | // "/articles/technology/42" 190 | path, err := r.Get("article").URLPath("category", "technology", "id", "42") 191 | 192 | And if you use subrouters, host and path defined separately can be built 193 | as well: 194 | 195 | r := mux.NewRouter() 196 | s := r.Host("{subdomain}.domain.com").Subrouter() 197 | s.Path("/articles/{category}/{id:[0-9]+}"). 198 | HandlerFunc(ArticleHandler). 199 | Name("article") 200 | 201 | // "http://news.domain.com/articles/technology/42" 202 | url, err := r.Get("article").URL("subdomain", "news", 203 | "category", "technology", 204 | "id", "42") 205 | */ 206 | package mux 207 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/bcrypt/base64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bcrypt 6 | 7 | import "encoding/base64" 8 | 9 | const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" 10 | 11 | var bcEncoding = base64.NewEncoding(alphabet) 12 | 13 | func base64Encode(src []byte) []byte { 14 | n := bcEncoding.EncodedLen(len(src)) 15 | dst := make([]byte, n) 16 | bcEncoding.Encode(dst, src) 17 | for dst[n-1] == '=' { 18 | n-- 19 | } 20 | return dst[:n] 21 | } 22 | 23 | func base64Decode(src []byte) ([]byte, error) { 24 | numOfEquals := 4 - (len(src) % 4) 25 | for i := 0; i < numOfEquals; i++ { 26 | src = append(src, '=') 27 | } 28 | 29 | dst := make([]byte, bcEncoding.DecodedLen(len(src))) 30 | n, err := bcEncoding.Decode(dst, src) 31 | if err != nil { 32 | return nil, err 33 | } 34 | return dst[:n], nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blowfish/block.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package blowfish 6 | 7 | // getNextWord returns the next big-endian uint32 value from the byte slice 8 | // at the given position in a circular manner, updating the position. 9 | func getNextWord(b []byte, pos *int) uint32 { 10 | var w uint32 11 | j := *pos 12 | for i := 0; i < 4; i++ { 13 | w = w<<8 | uint32(b[j]) 14 | j++ 15 | if j >= len(b) { 16 | j = 0 17 | } 18 | } 19 | *pos = j 20 | return w 21 | } 22 | 23 | // ExpandKey performs a key expansion on the given *Cipher. Specifically, it 24 | // performs the Blowfish algorithm's key schedule which sets up the *Cipher's 25 | // pi and substitution tables for calls to Encrypt. This is used, primarily, 26 | // by the bcrypt package to reuse the Blowfish key schedule during its 27 | // set up. It's unlikely that you need to use this directly. 28 | func ExpandKey(key []byte, c *Cipher) { 29 | j := 0 30 | for i := 0; i < 18; i++ { 31 | // Using inlined getNextWord for performance. 32 | var d uint32 33 | for k := 0; k < 4; k++ { 34 | d = d<<8 | uint32(key[j]) 35 | j++ 36 | if j >= len(key) { 37 | j = 0 38 | } 39 | } 40 | c.p[i] ^= d 41 | } 42 | 43 | var l, r uint32 44 | for i := 0; i < 18; i += 2 { 45 | l, r = encryptBlock(l, r, c) 46 | c.p[i], c.p[i+1] = l, r 47 | } 48 | 49 | for i := 0; i < 256; i += 2 { 50 | l, r = encryptBlock(l, r, c) 51 | c.s0[i], c.s0[i+1] = l, r 52 | } 53 | for i := 0; i < 256; i += 2 { 54 | l, r = encryptBlock(l, r, c) 55 | c.s1[i], c.s1[i+1] = l, r 56 | } 57 | for i := 0; i < 256; i += 2 { 58 | l, r = encryptBlock(l, r, c) 59 | c.s2[i], c.s2[i+1] = l, r 60 | } 61 | for i := 0; i < 256; i += 2 { 62 | l, r = encryptBlock(l, r, c) 63 | c.s3[i], c.s3[i+1] = l, r 64 | } 65 | } 66 | 67 | // This is similar to ExpandKey, but folds the salt during the key 68 | // schedule. While ExpandKey is essentially expandKeyWithSalt with an all-zero 69 | // salt passed in, reusing ExpandKey turns out to be a place of inefficiency 70 | // and specializing it here is useful. 71 | func expandKeyWithSalt(key []byte, salt []byte, c *Cipher) { 72 | j := 0 73 | for i := 0; i < 18; i++ { 74 | c.p[i] ^= getNextWord(key, &j) 75 | } 76 | 77 | j = 0 78 | var l, r uint32 79 | for i := 0; i < 18; i += 2 { 80 | l ^= getNextWord(salt, &j) 81 | r ^= getNextWord(salt, &j) 82 | l, r = encryptBlock(l, r, c) 83 | c.p[i], c.p[i+1] = l, r 84 | } 85 | 86 | for i := 0; i < 256; i += 2 { 87 | l ^= getNextWord(salt, &j) 88 | r ^= getNextWord(salt, &j) 89 | l, r = encryptBlock(l, r, c) 90 | c.s0[i], c.s0[i+1] = l, r 91 | } 92 | 93 | for i := 0; i < 256; i += 2 { 94 | l ^= getNextWord(salt, &j) 95 | r ^= getNextWord(salt, &j) 96 | l, r = encryptBlock(l, r, c) 97 | c.s1[i], c.s1[i+1] = l, r 98 | } 99 | 100 | for i := 0; i < 256; i += 2 { 101 | l ^= getNextWord(salt, &j) 102 | r ^= getNextWord(salt, &j) 103 | l, r = encryptBlock(l, r, c) 104 | c.s2[i], c.s2[i+1] = l, r 105 | } 106 | 107 | for i := 0; i < 256; i += 2 { 108 | l ^= getNextWord(salt, &j) 109 | r ^= getNextWord(salt, &j) 110 | l, r = encryptBlock(l, r, c) 111 | c.s3[i], c.s3[i+1] = l, r 112 | } 113 | } 114 | 115 | func encryptBlock(l, r uint32, c *Cipher) (uint32, uint32) { 116 | xl, xr := l, r 117 | xl ^= c.p[0] 118 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[1] 119 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[2] 120 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[3] 121 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[4] 122 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[5] 123 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[6] 124 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[7] 125 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[8] 126 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[9] 127 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[10] 128 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[11] 129 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[12] 130 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[13] 131 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[14] 132 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[15] 133 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[16] 134 | xr ^= c.p[17] 135 | return xr, xl 136 | } 137 | 138 | func decryptBlock(l, r uint32, c *Cipher) (uint32, uint32) { 139 | xl, xr := l, r 140 | xl ^= c.p[17] 141 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[16] 142 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[15] 143 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[14] 144 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[13] 145 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[12] 146 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[11] 147 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[10] 148 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[9] 149 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[8] 150 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[7] 151 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[6] 152 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[5] 153 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[4] 154 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[3] 155 | xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[2] 156 | xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[1] 157 | xr ^= c.p[0] 158 | return xr, xl 159 | } 160 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blowfish/cipher.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package blowfish implements Bruce Schneier's Blowfish encryption algorithm. 6 | package blowfish // import "golang.org/x/crypto/blowfish" 7 | 8 | // The code is a port of Bruce Schneier's C implementation. 9 | // See http://www.schneier.com/blowfish.html. 10 | 11 | import "strconv" 12 | 13 | // The Blowfish block size in bytes. 14 | const BlockSize = 8 15 | 16 | // A Cipher is an instance of Blowfish encryption using a particular key. 17 | type Cipher struct { 18 | p [18]uint32 19 | s0, s1, s2, s3 [256]uint32 20 | } 21 | 22 | type KeySizeError int 23 | 24 | func (k KeySizeError) Error() string { 25 | return "crypto/blowfish: invalid key size " + strconv.Itoa(int(k)) 26 | } 27 | 28 | // NewCipher creates and returns a Cipher. 29 | // The key argument should be the Blowfish key, from 1 to 56 bytes. 30 | func NewCipher(key []byte) (*Cipher, error) { 31 | var result Cipher 32 | if k := len(key); k < 1 || k > 56 { 33 | return nil, KeySizeError(k) 34 | } 35 | initCipher(&result) 36 | ExpandKey(key, &result) 37 | return &result, nil 38 | } 39 | 40 | // NewSaltedCipher creates a returns a Cipher that folds a salt into its key 41 | // schedule. For most purposes, NewCipher, instead of NewSaltedCipher, is 42 | // sufficient and desirable. For bcrypt compatiblity, the key can be over 56 43 | // bytes. 44 | func NewSaltedCipher(key, salt []byte) (*Cipher, error) { 45 | if len(salt) == 0 { 46 | return NewCipher(key) 47 | } 48 | var result Cipher 49 | if k := len(key); k < 1 { 50 | return nil, KeySizeError(k) 51 | } 52 | initCipher(&result) 53 | expandKeyWithSalt(key, salt, &result) 54 | return &result, nil 55 | } 56 | 57 | // BlockSize returns the Blowfish block size, 8 bytes. 58 | // It is necessary to satisfy the Block interface in the 59 | // package "crypto/cipher". 60 | func (c *Cipher) BlockSize() int { return BlockSize } 61 | 62 | // Encrypt encrypts the 8-byte buffer src using the key k 63 | // and stores the result in dst. 64 | // Note that for amounts of data larger than a block, 65 | // it is not safe to just call Encrypt on successive blocks; 66 | // instead, use an encryption mode like CBC (see crypto/cipher/cbc.go). 67 | func (c *Cipher) Encrypt(dst, src []byte) { 68 | l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) 69 | r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) 70 | l, r = encryptBlock(l, r, c) 71 | dst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l) 72 | dst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r) 73 | } 74 | 75 | // Decrypt decrypts the 8-byte buffer src using the key k 76 | // and stores the result in dst. 77 | func (c *Cipher) Decrypt(dst, src []byte) { 78 | l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) 79 | r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) 80 | l, r = decryptBlock(l, r, c) 81 | dst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l) 82 | dst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r) 83 | } 84 | 85 | func initCipher(c *Cipher) { 86 | copy(c.p[0:], p[0:]) 87 | copy(c.s0[0:], s0[0:]) 88 | copy(c.s1[0:], s1[0:]) 89 | copy(c.s2[0:], s2[0:]) 90 | copy(c.s3[0:], s3[0:]) 91 | } 92 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-32 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-44 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-56 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-32 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-44 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·socketcall(SB),NOSPLIT,$0-36 29 | JMP syscall·socketcall(SB) 30 | 31 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 32 | JMP syscall·rawsocketcall(SB) 33 | 34 | TEXT ·seek(SB),NOSPLIT,$0-28 35 | JMP syscall·seek(SB) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd openbsd netbsd dragonfly 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build darwin dragonfly freebsd linux netbsd openbsd 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 14 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 15 | var fcntl64Syscall uintptr = SYS_FCNTL 16 | 17 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 18 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 19 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 20 | if errno == 0 { 21 | return nil 22 | } 23 | return errno 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // We can't use the gc-syntax .s files for gccgo. On the plus side 12 | // much of the functionality can be written directly in Go. 13 | 14 | //extern gccgoRealSyscall 15 | func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr) 16 | 17 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | syscall.Entersyscall() 19 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 20 | syscall.Exitsyscall() 21 | return r, 0, syscall.Errno(errno) 22 | } 23 | 24 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 25 | syscall.Entersyscall() 26 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 27 | syscall.Exitsyscall() 28 | return r, 0, syscall.Errno(errno) 29 | } 30 | 31 | func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) { 32 | syscall.Entersyscall() 33 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9) 34 | syscall.Exitsyscall() 35 | return r, 0, syscall.Errno(errno) 36 | } 37 | 38 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 39 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 40 | return r, 0, syscall.Errno(errno) 41 | } 42 | 43 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 44 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 45 | return r, 0, syscall.Errno(errno) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | // Define the use function in C so that it is not inlined. 35 | 36 | extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); 37 | 38 | void 39 | use(void *p __attribute__ ((unused))) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | # Copyright 2011 The Go Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style 5 | # license that can be found in the LICENSE file. 6 | 7 | # 8 | # Parse the header files for OpenBSD and generate a Go usable sysctl MIB. 9 | # 10 | # Build a MIB with each entry being an array containing the level, type and 11 | # a hash that will contain additional entries if the current entry is a node. 12 | # We then walk this MIB and create a flattened sysctl name to OID hash. 13 | # 14 | 15 | use strict; 16 | 17 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 18 | print STDERR "GOARCH or GOOS not defined in environment\n"; 19 | exit 1; 20 | } 21 | 22 | my $debug = 0; 23 | my %ctls = (); 24 | 25 | my @headers = qw ( 26 | sys/sysctl.h 27 | sys/socket.h 28 | sys/tty.h 29 | sys/malloc.h 30 | sys/mount.h 31 | sys/namei.h 32 | sys/sem.h 33 | sys/shm.h 34 | sys/vmmeter.h 35 | uvm/uvm_param.h 36 | uvm/uvm_swap_encrypt.h 37 | ddb/db_var.h 38 | net/if.h 39 | net/if_pfsync.h 40 | net/pipex.h 41 | netinet/in.h 42 | netinet/icmp_var.h 43 | netinet/igmp_var.h 44 | netinet/ip_ah.h 45 | netinet/ip_carp.h 46 | netinet/ip_divert.h 47 | netinet/ip_esp.h 48 | netinet/ip_ether.h 49 | netinet/ip_gre.h 50 | netinet/ip_ipcomp.h 51 | netinet/ip_ipip.h 52 | netinet/pim_var.h 53 | netinet/tcp_var.h 54 | netinet/udp_var.h 55 | netinet6/in6.h 56 | netinet6/ip6_divert.h 57 | netinet6/pim6_var.h 58 | netinet/icmp6.h 59 | netmpls/mpls.h 60 | ); 61 | 62 | my @ctls = qw ( 63 | kern 64 | vm 65 | fs 66 | net 67 | #debug # Special handling required 68 | hw 69 | #machdep # Arch specific 70 | user 71 | ddb 72 | #vfs # Special handling required 73 | fs.posix 74 | kern.forkstat 75 | kern.intrcnt 76 | kern.malloc 77 | kern.nchstats 78 | kern.seminfo 79 | kern.shminfo 80 | kern.timecounter 81 | kern.tty 82 | kern.watchdog 83 | net.bpf 84 | net.ifq 85 | net.inet 86 | net.inet.ah 87 | net.inet.carp 88 | net.inet.divert 89 | net.inet.esp 90 | net.inet.etherip 91 | net.inet.gre 92 | net.inet.icmp 93 | net.inet.igmp 94 | net.inet.ip 95 | net.inet.ip.ifq 96 | net.inet.ipcomp 97 | net.inet.ipip 98 | net.inet.mobileip 99 | net.inet.pfsync 100 | net.inet.pim 101 | net.inet.tcp 102 | net.inet.udp 103 | net.inet6 104 | net.inet6.divert 105 | net.inet6.ip6 106 | net.inet6.icmp6 107 | net.inet6.pim6 108 | net.inet6.tcp6 109 | net.inet6.udp6 110 | net.mpls 111 | net.mpls.ifq 112 | net.key 113 | net.pflow 114 | net.pfsync 115 | net.pipex 116 | net.rt 117 | vm.swapencrypt 118 | #vfsgenctl # Special handling required 119 | ); 120 | 121 | # Node name "fixups" 122 | my %ctl_map = ( 123 | "ipproto" => "net.inet", 124 | "net.inet.ipproto" => "net.inet", 125 | "net.inet6.ipv6proto" => "net.inet6", 126 | "net.inet6.ipv6" => "net.inet6.ip6", 127 | "net.inet.icmpv6" => "net.inet6.icmp6", 128 | "net.inet6.divert6" => "net.inet6.divert", 129 | "net.inet6.tcp6" => "net.inet.tcp", 130 | "net.inet6.udp6" => "net.inet.udp", 131 | "mpls" => "net.mpls", 132 | "swpenc" => "vm.swapencrypt" 133 | ); 134 | 135 | # Node mappings 136 | my %node_map = ( 137 | "net.inet.ip.ifq" => "net.ifq", 138 | "net.inet.pfsync" => "net.pfsync", 139 | "net.mpls.ifq" => "net.ifq" 140 | ); 141 | 142 | my $ctlname; 143 | my %mib = (); 144 | my %sysctl = (); 145 | my $node; 146 | 147 | sub debug() { 148 | print STDERR "$_[0]\n" if $debug; 149 | } 150 | 151 | # Walk the MIB and build a sysctl name to OID mapping. 152 | sub build_sysctl() { 153 | my ($node, $name, $oid) = @_; 154 | my %node = %{$node}; 155 | my @oid = @{$oid}; 156 | 157 | foreach my $key (sort keys %node) { 158 | my @node = @{$node{$key}}; 159 | my $nodename = $name.($name ne '' ? '.' : '').$key; 160 | my @nodeoid = (@oid, $node[0]); 161 | if ($node[1] eq 'CTLTYPE_NODE') { 162 | if (exists $node_map{$nodename}) { 163 | $node = \%mib; 164 | $ctlname = $node_map{$nodename}; 165 | foreach my $part (split /\./, $ctlname) { 166 | $node = \%{@{$$node{$part}}[2]}; 167 | } 168 | } else { 169 | $node = $node[2]; 170 | } 171 | &build_sysctl($node, $nodename, \@nodeoid); 172 | } elsif ($node[1] ne '') { 173 | $sysctl{$nodename} = \@nodeoid; 174 | } 175 | } 176 | } 177 | 178 | foreach my $ctl (@ctls) { 179 | $ctls{$ctl} = $ctl; 180 | } 181 | 182 | # Build MIB 183 | foreach my $header (@headers) { 184 | &debug("Processing $header..."); 185 | open HEADER, "/usr/include/$header" || 186 | print STDERR "Failed to open $header\n"; 187 | while (
) { 188 | if ($_ =~ /^#define\s+(CTL_NAMES)\s+{/ || 189 | $_ =~ /^#define\s+(CTL_(.*)_NAMES)\s+{/ || 190 | $_ =~ /^#define\s+((.*)CTL_NAMES)\s+{/) { 191 | if ($1 eq 'CTL_NAMES') { 192 | # Top level. 193 | $node = \%mib; 194 | } else { 195 | # Node. 196 | my $nodename = lc($2); 197 | if ($header =~ /^netinet\//) { 198 | $ctlname = "net.inet.$nodename"; 199 | } elsif ($header =~ /^netinet6\//) { 200 | $ctlname = "net.inet6.$nodename"; 201 | } elsif ($header =~ /^net\//) { 202 | $ctlname = "net.$nodename"; 203 | } else { 204 | $ctlname = "$nodename"; 205 | $ctlname =~ s/^(fs|net|kern)_/$1\./; 206 | } 207 | if (exists $ctl_map{$ctlname}) { 208 | $ctlname = $ctl_map{$ctlname}; 209 | } 210 | if (not exists $ctls{$ctlname}) { 211 | &debug("Ignoring $ctlname..."); 212 | next; 213 | } 214 | 215 | # Walk down from the top of the MIB. 216 | $node = \%mib; 217 | foreach my $part (split /\./, $ctlname) { 218 | if (not exists $$node{$part}) { 219 | &debug("Missing node $part"); 220 | $$node{$part} = [ 0, '', {} ]; 221 | } 222 | $node = \%{@{$$node{$part}}[2]}; 223 | } 224 | } 225 | 226 | # Populate current node with entries. 227 | my $i = -1; 228 | while (defined($_) && $_ !~ /^}/) { 229 | $_ =
; 230 | $i++ if $_ =~ /{.*}/; 231 | next if $_ !~ /{\s+"(\w+)",\s+(CTLTYPE_[A-Z]+)\s+}/; 232 | $$node{$1} = [ $i, $2, {} ]; 233 | } 234 | } 235 | } 236 | close HEADER; 237 | } 238 | 239 | &build_sysctl(\%mib, "", []); 240 | 241 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print <){ 30 | if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | if($name =~ /^SYS_CAP_+/ || $name =~ /^SYS___CAP_+/){ 44 | next 45 | } 46 | 47 | print " $name = $num; // $proto\n"; 48 | 49 | # We keep Capsicum syscall numbers for FreeBSD 50 | # 9-STABLE here because we are not sure whether they 51 | # are mature and stable. 52 | if($num == 513){ 53 | print " SYS_CAP_NEW = 514 // { int cap_new(int fd, uint64_t rights); }\n"; 54 | print " SYS_CAP_GETRIGHTS = 515 // { int cap_getrights(int fd, \\\n"; 55 | print " SYS_CAP_ENTER = 516 // { int cap_enter(void); }\n"; 56 | print " SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); }\n"; 57 | } 58 | } 59 | } 60 | 61 | print < 999){ 29 | # ignore deprecated syscalls that are no longer implemented 30 | # https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h?id=refs/heads/master#n716 31 | return; 32 | } 33 | $name =~ y/a-z/A-Z/; 34 | print " SYS_$name = $num;\n"; 35 | } 36 | 37 | my $prev; 38 | open(GCC, "gcc -E -dD $ARGV[0] |") || die "can't run gcc"; 39 | while(){ 40 | if(/^#define __NR_syscalls\s+/) { 41 | # ignore redefinitions of __NR_syscalls 42 | } 43 | elsif(/^#define __NR_(\w+)\s+([0-9]+)/){ 44 | $prev = $2; 45 | fmt($1, $2); 46 | } 47 | elsif(/^#define __NR3264_(\w+)\s+([0-9]+)/){ 48 | $prev = $2; 49 | fmt($1, $2); 50 | } 51 | elsif(/^#define __NR_(\w+)\s+\(\w+\+\s*([0-9]+)\)/){ 52 | fmt($1, $prev+$2) 53 | } 54 | } 55 | 56 | print <){ 31 | if($line =~ /^(.*)\\$/) { 32 | # Handle continuation 33 | $line = $1; 34 | $_ =~ s/^\s+//; 35 | $line .= $_; 36 | } else { 37 | # New line 38 | $line = $_; 39 | } 40 | next if $line =~ /\\$/; 41 | if($line =~ /^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$/) { 42 | my $num = $1; 43 | my $proto = $6; 44 | my $compat = $8; 45 | my $name = "$7_$9"; 46 | 47 | $name = "$7_$11" if $11 ne ''; 48 | $name =~ y/a-z/A-Z/; 49 | 50 | if($compat eq '' || $compat eq '30' || $compat eq '50') { 51 | print " $name = $num; // $proto\n"; 52 | } 53 | } 54 | } 55 | 56 | print <){ 30 | if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $3; 33 | my $name = $4; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print < len(b) { 66 | return nil, nil, EINVAL 67 | } 68 | return h, b[cmsgAlignOf(SizeofCmsghdr):h.Len], nil 69 | } 70 | 71 | // UnixRights encodes a set of open file descriptors into a socket 72 | // control message for sending to another process. 73 | func UnixRights(fds ...int) []byte { 74 | datalen := len(fds) * 4 75 | b := make([]byte, CmsgSpace(datalen)) 76 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 77 | h.Level = SOL_SOCKET 78 | h.Type = SCM_RIGHTS 79 | h.SetLen(CmsgLen(datalen)) 80 | data := cmsgData(h) 81 | for _, fd := range fds { 82 | *(*int32)(data) = int32(fd) 83 | data = unsafe.Pointer(uintptr(data) + 4) 84 | } 85 | return b 86 | } 87 | 88 | // ParseUnixRights decodes a socket control message that contains an 89 | // integer array of open file descriptors from another process. 90 | func ParseUnixRights(m *SocketControlMessage) ([]int, error) { 91 | if m.Header.Level != SOL_SOCKET { 92 | return nil, EINVAL 93 | } 94 | if m.Header.Type != SCM_RIGHTS { 95 | return nil, EINVAL 96 | } 97 | fds := make([]int, len(m.Data)>>2) 98 | for i, j := 0, 0; i < len(m.Data); i += 4 { 99 | fds[j] = int(*(*int32)(unsafe.Pointer(&m.Data[i]))) 100 | j++ 101 | } 102 | return fds, nil 103 | } 104 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Package unix contains an interface to the low-level operating system 8 | // primitives. OS details vary depending on the underlying system, and 9 | // by default, godoc will display OS-specific documentation for the current 10 | // system. If you want godoc to display OS documentation for another 11 | // system, set $GOOS and $GOARCH to the desired system. For example, if 12 | // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS 13 | // to freebsd and $GOARCH to arm. 14 | // The primary use of this package is inside other packages that provide a more 15 | // portable interface to the system, such as "os", "time" and "net". Use 16 | // those packages rather than this one if you can. 17 | // For details of the functions and data types in this package consult 18 | // the manuals for the appropriate operating system. 19 | // These calls return err == nil to indicate success; otherwise 20 | // err represents an operating system error describing the failure and 21 | // holds a value of type syscall.Errno. 22 | package unix // import "golang.org/x/sys/unix" 23 | 24 | import "unsafe" 25 | 26 | // ByteSliceFromString returns a NUL-terminated slice of bytes 27 | // containing the text of s. If s contains a NUL byte at any 28 | // location, it returns (nil, EINVAL). 29 | func ByteSliceFromString(s string) ([]byte, error) { 30 | for i := 0; i < len(s); i++ { 31 | if s[i] == 0 { 32 | return nil, EINVAL 33 | } 34 | } 35 | a := make([]byte, len(s)+1) 36 | copy(a, s) 37 | return a, nil 38 | } 39 | 40 | // BytePtrFromString returns a pointer to a NUL-terminated array of 41 | // bytes containing the text of s. If s contains a NUL byte at any 42 | // location, it returns (nil, EINVAL). 43 | func BytePtrFromString(s string) (*byte, error) { 44 | a, err := ByteSliceFromString(s) 45 | if err != nil { 46 | return nil, err 47 | } 48 | return &a[0], nil 49 | } 50 | 51 | // Single-word zero for use when we need a valid pointer to 0 bytes. 52 | // See mkunix.pl. 53 | var _zero uintptr 54 | 55 | func (ts *Timespec) Unix() (sec int64, nsec int64) { 56 | return int64(ts.Sec), int64(ts.Nsec) 57 | } 58 | 59 | func (tv *Timeval) Unix() (sec int64, nsec int64) { 60 | return int64(tv.Sec), int64(tv.Usec) * 1000 61 | } 62 | 63 | func (ts *Timespec) Nano() int64 { 64 | return int64(ts.Sec)*1e9 + int64(ts.Nsec) 65 | } 66 | 67 | func (tv *Timeval) Nano() int64 { 68 | return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 69 | } 70 | 71 | // use is a no-op, but the compiler cannot see that it is. 72 | // Calling use(p) ensures that p is kept live until that point. 73 | //go:noescape 74 | func use(p unsafe.Pointer) 75 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = int32(nsec / 1e9) 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 25 | 26 | func NsecToTimeval(nsec int64) (tv Timeval) { 27 | nsec += 999 // round up to microsecond 28 | tv.Usec = int32(nsec % 1e9 / 1e3) 29 | tv.Sec = int32(nsec / 1e9) 30 | return 31 | } 32 | 33 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) 34 | func Gettimeofday(tv *Timeval) (err error) { 35 | // The tv passed to gettimeofday must be non-nil 36 | // but is otherwise unused. The answers come back 37 | // in the two registers. 38 | sec, usec, err := gettimeofday(tv) 39 | tv.Sec = int32(sec) 40 | tv.Usec = int32(usec) 41 | return err 42 | } 43 | 44 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 45 | k.Ident = uint32(fd) 46 | k.Filter = int16(mode) 47 | k.Flags = uint16(flags) 48 | } 49 | 50 | func (iov *Iovec) SetLen(length int) { 51 | iov.Len = uint32(length) 52 | } 53 | 54 | func (msghdr *Msghdr) SetControllen(length int) { 55 | msghdr.Controllen = uint32(length) 56 | } 57 | 58 | func (cmsg *Cmsghdr) SetLen(length int) { 59 | cmsg.Len = uint32(length) 60 | } 61 | 62 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 63 | var length = uint64(count) 64 | 65 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) 66 | 67 | written = int(length) 68 | 69 | if e1 != 0 { 70 | err = e1 71 | } 72 | return 73 | } 74 | 75 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 76 | 77 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 78 | // of darwin/386 the syscall is called sysctl instead of __sysctl. 79 | const SYS___SYSCTL = SYS_SYSCTL 80 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) 15 | 16 | func Getpagesize() int { return 4096 } 17 | 18 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 19 | 20 | func NsecToTimespec(nsec int64) (ts Timespec) { 21 | ts.Sec = nsec / 1e9 22 | ts.Nsec = nsec % 1e9 23 | return 24 | } 25 | 26 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 27 | 28 | func NsecToTimeval(nsec int64) (tv Timeval) { 29 | nsec += 999 // round up to microsecond 30 | tv.Usec = int32(nsec % 1e9 / 1e3) 31 | tv.Sec = int64(nsec / 1e9) 32 | return 33 | } 34 | 35 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 36 | func Gettimeofday(tv *Timeval) (err error) { 37 | // The tv passed to gettimeofday must be non-nil 38 | // but is otherwise unused. The answers come back 39 | // in the two registers. 40 | sec, usec, err := gettimeofday(tv) 41 | tv.Sec = sec 42 | tv.Usec = usec 43 | return err 44 | } 45 | 46 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 47 | k.Ident = uint64(fd) 48 | k.Filter = int16(mode) 49 | k.Flags = uint16(flags) 50 | } 51 | 52 | func (iov *Iovec) SetLen(length int) { 53 | iov.Len = uint64(length) 54 | } 55 | 56 | func (msghdr *Msghdr) SetControllen(length int) { 57 | msghdr.Controllen = uint32(length) 58 | } 59 | 60 | func (cmsg *Cmsghdr) SetLen(length int) { 61 | cmsg.Len = uint32(length) 62 | } 63 | 64 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 65 | var length = uint64(count) 66 | 67 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 68 | 69 | written = int(length) 70 | 71 | if e1 != 0 { 72 | err = e1 73 | } 74 | return 75 | } 76 | 77 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 78 | 79 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 80 | // of darwin/amd64 the syscall is called sysctl instead of __sysctl. 81 | const SYS___SYSCTL = SYS_SYSCTL 82 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | func Getpagesize() int { return 4096 } 13 | 14 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 15 | 16 | func NsecToTimespec(nsec int64) (ts Timespec) { 17 | ts.Sec = int32(nsec / 1e9) 18 | ts.Nsec = int32(nsec % 1e9) 19 | return 20 | } 21 | 22 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int32(nsec / 1e9) 28 | return 29 | } 30 | 31 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) 32 | func Gettimeofday(tv *Timeval) (err error) { 33 | // The tv passed to gettimeofday must be non-nil 34 | // but is otherwise unused. The answers come back 35 | // in the two registers. 36 | sec, usec, err := gettimeofday(tv) 37 | tv.Sec = int32(sec) 38 | tv.Usec = int32(usec) 39 | return err 40 | } 41 | 42 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 43 | k.Ident = uint32(fd) 44 | k.Filter = int16(mode) 45 | k.Flags = uint16(flags) 46 | } 47 | 48 | func (iov *Iovec) SetLen(length int) { 49 | iov.Len = uint32(length) 50 | } 51 | 52 | func (msghdr *Msghdr) SetControllen(length int) { 53 | msghdr.Controllen = uint32(length) 54 | } 55 | 56 | func (cmsg *Cmsghdr) SetLen(length int) { 57 | cmsg.Len = uint32(length) 58 | } 59 | 60 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 61 | var length = uint64(count) 62 | 63 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) 64 | 65 | written = int(length) 66 | 67 | if e1 != 0 { 68 | err = e1 69 | } 70 | return 71 | } 72 | 73 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 74 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 16384 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 25 | 26 | func NsecToTimeval(nsec int64) (tv Timeval) { 27 | nsec += 999 // round up to microsecond 28 | tv.Usec = int32(nsec % 1e9 / 1e3) 29 | tv.Sec = int64(nsec / 1e9) 30 | return 31 | } 32 | 33 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 34 | func Gettimeofday(tv *Timeval) (err error) { 35 | // The tv passed to gettimeofday must be non-nil 36 | // but is otherwise unused. The answers come back 37 | // in the two registers. 38 | sec, usec, err := gettimeofday(tv) 39 | tv.Sec = sec 40 | tv.Usec = usec 41 | return err 42 | } 43 | 44 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 45 | k.Ident = uint64(fd) 46 | k.Filter = int16(mode) 47 | k.Flags = uint16(flags) 48 | } 49 | 50 | func (iov *Iovec) SetLen(length int) { 51 | iov.Len = uint64(length) 52 | } 53 | 54 | func (msghdr *Msghdr) SetControllen(length int) { 55 | msghdr.Controllen = uint32(length) 56 | } 57 | 58 | func (cmsg *Cmsghdr) SetLen(length int) { 59 | cmsg.Len = uint32(length) 60 | } 61 | 62 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 63 | var length = uint64(count) 64 | 65 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 66 | 67 | written = int(length) 68 | 69 | if e1 != 0 { 70 | err = e1 71 | } 72 | return 73 | } 74 | 75 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 76 | 77 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 78 | // of darwin/arm64 the syscall is called sysctl instead of __sysctl. 79 | const SYS___SYSCTL = SYS_SYSCTL 80 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = int32(nsec / 1e9) 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 25 | 26 | func NsecToTimeval(nsec int64) (tv Timeval) { 27 | nsec += 999 // round up to microsecond 28 | tv.Usec = int32(nsec % 1e9 / 1e3) 29 | tv.Sec = int32(nsec / 1e9) 30 | return 31 | } 32 | 33 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 34 | k.Ident = uint32(fd) 35 | k.Filter = int16(mode) 36 | k.Flags = uint16(flags) 37 | } 38 | 39 | func (iov *Iovec) SetLen(length int) { 40 | iov.Len = uint32(length) 41 | } 42 | 43 | func (msghdr *Msghdr) SetControllen(length int) { 44 | msghdr.Controllen = uint32(length) 45 | } 46 | 47 | func (cmsg *Cmsghdr) SetLen(length int) { 48 | cmsg.Len = uint32(length) 49 | } 50 | 51 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 52 | var writtenOut uint64 = 0 53 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 54 | 55 | written = int(writtenOut) 56 | 57 | if e1 != 0 { 58 | err = e1 59 | } 60 | return 61 | } 62 | 63 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 25 | 26 | func NsecToTimeval(nsec int64) (tv Timeval) { 27 | nsec += 999 // round up to microsecond 28 | tv.Usec = nsec % 1e9 / 1e3 29 | tv.Sec = int64(nsec / 1e9) 30 | return 31 | } 32 | 33 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 34 | k.Ident = uint64(fd) 35 | k.Filter = int16(mode) 36 | k.Flags = uint16(flags) 37 | } 38 | 39 | func (iov *Iovec) SetLen(length int) { 40 | iov.Len = uint64(length) 41 | } 42 | 43 | func (msghdr *Msghdr) SetControllen(length int) { 44 | msghdr.Controllen = uint32(length) 45 | } 46 | 47 | func (cmsg *Cmsghdr) SetLen(length int) { 48 | cmsg.Len = uint32(length) 49 | } 50 | 51 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 52 | var writtenOut uint64 = 0 53 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 54 | 55 | written = int(writtenOut) 56 | 57 | if e1 != 0 { 58 | err = e1 59 | } 60 | return 61 | } 62 | 63 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = int32(nsec / 1e9) 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 25 | 26 | func NsecToTimeval(nsec int64) (tv Timeval) { 27 | nsec += 999 // round up to microsecond 28 | tv.Usec = int32(nsec % 1e9 / 1e3) 29 | tv.Sec = int32(nsec / 1e9) 30 | return 31 | } 32 | 33 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 34 | k.Ident = uint32(fd) 35 | k.Filter = int16(mode) 36 | k.Flags = uint16(flags) 37 | } 38 | 39 | func (iov *Iovec) SetLen(length int) { 40 | iov.Len = uint32(length) 41 | } 42 | 43 | func (msghdr *Msghdr) SetControllen(length int) { 44 | msghdr.Controllen = uint32(length) 45 | } 46 | 47 | func (cmsg *Cmsghdr) SetLen(length int) { 48 | cmsg.Len = uint32(length) 49 | } 50 | 51 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 52 | var writtenOut uint64 = 0 53 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 54 | 55 | written = int(writtenOut) 56 | 57 | if e1 != 0 { 58 | err = e1 59 | } 60 | return 61 | } 62 | 63 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 25 | 26 | func NsecToTimeval(nsec int64) (tv Timeval) { 27 | nsec += 999 // round up to microsecond 28 | tv.Usec = nsec % 1e9 / 1e3 29 | tv.Sec = int64(nsec / 1e9) 30 | return 31 | } 32 | 33 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 34 | k.Ident = uint64(fd) 35 | k.Filter = int16(mode) 36 | k.Flags = uint16(flags) 37 | } 38 | 39 | func (iov *Iovec) SetLen(length int) { 40 | iov.Len = uint64(length) 41 | } 42 | 43 | func (msghdr *Msghdr) SetControllen(length int) { 44 | msghdr.Controllen = uint32(length) 45 | } 46 | 47 | func (cmsg *Cmsghdr) SetLen(length int) { 48 | cmsg.Len = uint32(length) 49 | } 50 | 51 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 52 | var writtenOut uint64 = 0 53 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 54 | 55 | written = int(writtenOut) 56 | 57 | if e1 != 0 { 58 | err = e1 59 | } 60 | return 61 | } 62 | 63 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return ts.Sec*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func TimevalToNsec(tv Timeval) int64 { return tv.Sec*1e9 + int64(tv.Usec)*1e3 } 25 | 26 | func NsecToTimeval(nsec int64) (tv Timeval) { 27 | nsec += 999 // round up to microsecond 28 | tv.Usec = int32(nsec % 1e9 / 1e3) 29 | tv.Sec = nsec / 1e9 30 | return 31 | } 32 | 33 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 34 | k.Ident = uint32(fd) 35 | k.Filter = int16(mode) 36 | k.Flags = uint16(flags) 37 | } 38 | 39 | func (iov *Iovec) SetLen(length int) { 40 | iov.Len = uint32(length) 41 | } 42 | 43 | func (msghdr *Msghdr) SetControllen(length int) { 44 | msghdr.Controllen = uint32(length) 45 | } 46 | 47 | func (cmsg *Cmsghdr) SetLen(length int) { 48 | cmsg.Len = uint32(length) 49 | } 50 | 51 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 52 | var writtenOut uint64 = 0 53 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 54 | 55 | written = int(writtenOut) 56 | 57 | if e1 != 0 { 58 | err = e1 59 | } 60 | return 61 | } 62 | 63 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 64 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //sys Dup2(oldfd int, newfd int) (err error) 12 | //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 13 | //sys Fchown(fd int, uid int, gid int) (err error) 14 | //sys Fstat(fd int, stat *Stat_t) (err error) 15 | //sys Fstatfs(fd int, buf *Statfs_t) (err error) 16 | //sys Ftruncate(fd int, length int64) (err error) 17 | //sysnb Getegid() (egid int) 18 | //sysnb Geteuid() (euid int) 19 | //sysnb Getgid() (gid int) 20 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 21 | //sysnb Getuid() (uid int) 22 | //sysnb InotifyInit() (fd int, err error) 23 | //sys Ioperm(from int, num int, on int) (err error) 24 | //sys Iopl(level int) (err error) 25 | //sys Lchown(path string, uid int, gid int) (err error) 26 | //sys Listen(s int, n int) (err error) 27 | //sys Lstat(path string, stat *Stat_t) (err error) 28 | //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 29 | //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 30 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK 31 | //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) 32 | //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) 33 | //sys Setfsgid(gid int) (err error) 34 | //sys Setfsuid(uid int) (err error) 35 | //sysnb Setregid(rgid int, egid int) (err error) 36 | //sysnb Setresgid(rgid int, egid int, sgid int) (err error) 37 | //sysnb Setresuid(ruid int, euid int, suid int) (err error) 38 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 39 | //sysnb Setreuid(ruid int, euid int) (err error) 40 | //sys Shutdown(fd int, how int) (err error) 41 | //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) 42 | //sys Stat(path string, stat *Stat_t) (err error) 43 | //sys Statfs(path string, buf *Statfs_t) (err error) 44 | //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) 45 | //sys Truncate(path string, length int64) (err error) 46 | //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) 47 | //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) 48 | //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 49 | //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 50 | //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) 51 | //sysnb setgroups(n int, list *_Gid_t) (err error) 52 | //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) 53 | //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) 54 | //sysnb socket(domain int, typ int, proto int) (fd int, err error) 55 | //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) 56 | //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 57 | //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 58 | //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) 59 | //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) 60 | //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) 61 | //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) 62 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 63 | 64 | //go:noescape 65 | func gettimeofday(tv *Timeval) (err syscall.Errno) 66 | 67 | func Gettimeofday(tv *Timeval) (err error) { 68 | errno := gettimeofday(tv) 69 | if errno != 0 { 70 | return errno 71 | } 72 | return nil 73 | } 74 | 75 | func Getpagesize() int { return 4096 } 76 | 77 | func Time(t *Time_t) (tt Time_t, err error) { 78 | var tv Timeval 79 | errno := gettimeofday(&tv) 80 | if errno != 0 { 81 | return 0, errno 82 | } 83 | if t != nil { 84 | *t = Time_t(tv.Sec) 85 | } 86 | return Time_t(tv.Sec), nil 87 | } 88 | 89 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 90 | 91 | func NsecToTimespec(nsec int64) (ts Timespec) { 92 | ts.Sec = nsec / 1e9 93 | ts.Nsec = nsec % 1e9 94 | return 95 | } 96 | 97 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 98 | 99 | func NsecToTimeval(nsec int64) (tv Timeval) { 100 | nsec += 999 // round up to microsecond 101 | tv.Sec = nsec / 1e9 102 | tv.Usec = nsec % 1e9 / 1e3 103 | return 104 | } 105 | 106 | //sysnb pipe(p *[2]_C_int) (err error) 107 | 108 | func Pipe(p []int) (err error) { 109 | if len(p) != 2 { 110 | return EINVAL 111 | } 112 | var pp [2]_C_int 113 | err = pipe(&pp) 114 | p[0] = int(pp[0]) 115 | p[1] = int(pp[1]) 116 | return 117 | } 118 | 119 | //sysnb pipe2(p *[2]_C_int, flags int) (err error) 120 | 121 | func Pipe2(p []int, flags int) (err error) { 122 | if len(p) != 2 { 123 | return EINVAL 124 | } 125 | var pp [2]_C_int 126 | err = pipe2(&pp, flags) 127 | p[0] = int(pp[0]) 128 | p[1] = int(pp[1]) 129 | return 130 | } 131 | 132 | func (r *PtraceRegs) PC() uint64 { return r.Rip } 133 | 134 | func (r *PtraceRegs) SetPC(pc uint64) { r.Rip = pc } 135 | 136 | func (iov *Iovec) SetLen(length int) { 137 | iov.Len = uint64(length) 138 | } 139 | 140 | func (msghdr *Msghdr) SetControllen(length int) { 141 | msghdr.Controllen = uint64(length) 142 | } 143 | 144 | func (cmsg *Cmsghdr) SetLen(length int) { 145 | cmsg.Len = uint64(length) 146 | } 147 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64,linux 6 | 7 | package unix 8 | 9 | const _SYS_dup = SYS_DUP3 10 | 11 | //sys Fchown(fd int, uid int, gid int) (err error) 12 | //sys Fstat(fd int, stat *Stat_t) (err error) 13 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) 14 | //sys Fstatfs(fd int, buf *Statfs_t) (err error) 15 | //sys Ftruncate(fd int, length int64) (err error) 16 | //sysnb Getegid() (egid int) 17 | //sysnb Geteuid() (euid int) 18 | //sysnb Getgid() (gid int) 19 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 20 | //sysnb Getuid() (uid int) 21 | //sys Listen(s int, n int) (err error) 22 | //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 23 | //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 24 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK 25 | //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6 26 | //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) 27 | //sys Setfsgid(gid int) (err error) 28 | //sys Setfsuid(uid int) (err error) 29 | //sysnb Setregid(rgid int, egid int) (err error) 30 | //sysnb Setresgid(rgid int, egid int, sgid int) (err error) 31 | //sysnb Setresuid(ruid int, euid int, suid int) (err error) 32 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 33 | //sysnb Setreuid(ruid int, euid int) (err error) 34 | //sys Shutdown(fd int, how int) (err error) 35 | //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) 36 | 37 | func Stat(path string, stat *Stat_t) (err error) { 38 | return Fstatat(AT_FDCWD, path, stat, 0) 39 | } 40 | 41 | func Lchown(path string, uid int, gid int) (err error) { 42 | return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW) 43 | } 44 | 45 | func Lstat(path string, stat *Stat_t) (err error) { 46 | return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) 47 | } 48 | 49 | //sys Statfs(path string, buf *Statfs_t) (err error) 50 | //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) 51 | //sys Truncate(path string, length int64) (err error) 52 | //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) 53 | //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) 54 | //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 55 | //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 56 | //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) 57 | //sysnb setgroups(n int, list *_Gid_t) (err error) 58 | //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) 59 | //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) 60 | //sysnb socket(domain int, typ int, proto int) (fd int, err error) 61 | //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) 62 | //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 63 | //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 64 | //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) 65 | //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) 66 | //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) 67 | //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) 68 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 69 | 70 | func Getpagesize() int { return 65536 } 71 | 72 | //sysnb Gettimeofday(tv *Timeval) (err error) 73 | //sysnb Time(t *Time_t) (tt Time_t, err error) 74 | 75 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 76 | 77 | func NsecToTimespec(nsec int64) (ts Timespec) { 78 | ts.Sec = nsec / 1e9 79 | ts.Nsec = nsec % 1e9 80 | return 81 | } 82 | 83 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 84 | 85 | func NsecToTimeval(nsec int64) (tv Timeval) { 86 | nsec += 999 // round up to microsecond 87 | tv.Sec = nsec / 1e9 88 | tv.Usec = nsec % 1e9 / 1e3 89 | return 90 | } 91 | 92 | func Pipe(p []int) (err error) { 93 | if len(p) != 2 { 94 | return EINVAL 95 | } 96 | var pp [2]_C_int 97 | err = pipe2(&pp, 0) 98 | p[0] = int(pp[0]) 99 | p[1] = int(pp[1]) 100 | return 101 | } 102 | 103 | //sysnb pipe2(p *[2]_C_int, flags int) (err error) 104 | 105 | func Pipe2(p []int, flags int) (err error) { 106 | if len(p) != 2 { 107 | return EINVAL 108 | } 109 | var pp [2]_C_int 110 | err = pipe2(&pp, flags) 111 | p[0] = int(pp[0]) 112 | p[1] = int(pp[1]) 113 | return 114 | } 115 | 116 | func (r *PtraceRegs) PC() uint64 { return r.Pc } 117 | 118 | func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc } 119 | 120 | func (iov *Iovec) SetLen(length int) { 121 | iov.Len = uint64(length) 122 | } 123 | 124 | func (msghdr *Msghdr) SetControllen(length int) { 125 | msghdr.Controllen = uint64(length) 126 | } 127 | 128 | func (cmsg *Cmsghdr) SetLen(length int) { 129 | cmsg.Len = uint64(length) 130 | } 131 | 132 | func InotifyInit() (fd int, err error) { 133 | return InotifyInit1(0) 134 | } 135 | 136 | // TODO(dfc): constants that should be in zsysnum_linux_arm64.go, remove 137 | // these when the deprecated syscalls that the syscall package relies on 138 | // are removed. 139 | const ( 140 | SYS_GETPGRP = 1060 141 | SYS_UTIMES = 1037 142 | SYS_FUTIMESAT = 1066 143 | SYS_PAUSE = 1061 144 | SYS_USTAT = 1070 145 | SYS_UTIME = 1063 146 | SYS_LCHOWN = 1032 147 | SYS_TIME = 1062 148 | SYS_EPOLL_CREATE = 1042 149 | SYS_EPOLL_WAIT = 1069 150 | ) 151 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | 8 | package unix 9 | 10 | //sys Fchown(fd int, uid int, gid int) (err error) 11 | //sys Fstat(fd int, stat *Stat_t) (err error) 12 | //sys Fstatfs(fd int, buf *Statfs_t) (err error) 13 | //sys Ftruncate(fd int, length int64) (err error) 14 | //sysnb Getegid() (egid int) 15 | //sysnb Geteuid() (euid int) 16 | //sysnb Getgid() (gid int) 17 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = SYS_UGETRLIMIT 18 | //sysnb Getuid() (uid int) 19 | //sys Ioperm(from int, num int, on int) (err error) 20 | //sys Iopl(level int) (err error) 21 | //sys Lchown(path string, uid int, gid int) (err error) 22 | //sys Listen(s int, n int) (err error) 23 | //sys Lstat(path string, stat *Stat_t) (err error) 24 | //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 25 | //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 26 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK 27 | //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) 28 | //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) 29 | //sys Setfsgid(gid int) (err error) 30 | //sys Setfsuid(uid int) (err error) 31 | //sysnb Setregid(rgid int, egid int) (err error) 32 | //sysnb Setresgid(rgid int, egid int, sgid int) (err error) 33 | //sysnb Setresuid(ruid int, euid int, suid int) (err error) 34 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 35 | //sysnb Setreuid(ruid int, euid int) (err error) 36 | //sys Shutdown(fd int, how int) (err error) 37 | //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) 38 | //sys Stat(path string, stat *Stat_t) (err error) 39 | //sys Statfs(path string, buf *Statfs_t) (err error) 40 | //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) = SYS_SYNC_FILE_RANGE2 41 | //sys Truncate(path string, length int64) (err error) 42 | //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) 43 | //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) 44 | //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 45 | //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 46 | //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) 47 | //sysnb setgroups(n int, list *_Gid_t) (err error) 48 | //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) 49 | //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) 50 | //sysnb socket(domain int, typ int, proto int) (fd int, err error) 51 | //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) 52 | //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 53 | //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 54 | //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) 55 | //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) 56 | //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) 57 | //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) 58 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 59 | 60 | func Getpagesize() int { return 65536 } 61 | 62 | //sysnb Gettimeofday(tv *Timeval) (err error) 63 | //sysnb Time(t *Time_t) (tt Time_t, err error) 64 | 65 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 66 | 67 | func NsecToTimespec(nsec int64) (ts Timespec) { 68 | ts.Sec = nsec / 1e9 69 | ts.Nsec = nsec % 1e9 70 | return 71 | } 72 | 73 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 74 | 75 | func NsecToTimeval(nsec int64) (tv Timeval) { 76 | nsec += 999 // round up to microsecond 77 | tv.Sec = nsec / 1e9 78 | tv.Usec = nsec % 1e9 / 1e3 79 | return 80 | } 81 | 82 | func (r *PtraceRegs) PC() uint64 { return r.Nip } 83 | 84 | func (r *PtraceRegs) SetPC(pc uint64) { r.Nip = pc } 85 | 86 | func (iov *Iovec) SetLen(length int) { 87 | iov.Len = uint64(length) 88 | } 89 | 90 | func (msghdr *Msghdr) SetControllen(length int) { 91 | msghdr.Controllen = uint64(length) 92 | } 93 | 94 | func (cmsg *Cmsghdr) SetLen(length int) { 95 | cmsg.Len = uint64(length) 96 | } 97 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 20 | 21 | func NsecToTimeval(nsec int64) (tv Timeval) { 22 | nsec += 999 // round up to microsecond 23 | tv.Usec = int32(nsec % 1e9 / 1e3) 24 | tv.Sec = int64(nsec / 1e9) 25 | return 26 | } 27 | 28 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 29 | k.Ident = uint32(fd) 30 | k.Filter = uint32(mode) 31 | k.Flags = uint32(flags) 32 | } 33 | 34 | func (iov *Iovec) SetLen(length int) { 35 | iov.Len = uint32(length) 36 | } 37 | 38 | func (msghdr *Msghdr) SetControllen(length int) { 39 | msghdr.Controllen = uint32(length) 40 | } 41 | 42 | func (cmsg *Cmsghdr) SetLen(length int) { 43 | cmsg.Len = uint32(length) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int64(nsec % 1e9) 16 | return 17 | } 18 | 19 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 20 | 21 | func NsecToTimeval(nsec int64) (tv Timeval) { 22 | nsec += 999 // round up to microsecond 23 | tv.Usec = int32(nsec % 1e9 / 1e3) 24 | tv.Sec = int64(nsec / 1e9) 25 | return 26 | } 27 | 28 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 29 | k.Ident = uint64(fd) 30 | k.Filter = uint32(mode) 31 | k.Flags = uint32(flags) 32 | } 33 | 34 | func (iov *Iovec) SetLen(length int) { 35 | iov.Len = uint64(length) 36 | } 37 | 38 | func (msghdr *Msghdr) SetControllen(length int) { 39 | msghdr.Controllen = uint32(length) 40 | } 41 | 42 | func (cmsg *Cmsghdr) SetLen(length int) { 43 | cmsg.Len = uint32(length) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 20 | 21 | func NsecToTimeval(nsec int64) (tv Timeval) { 22 | nsec += 999 // round up to microsecond 23 | tv.Usec = int32(nsec % 1e9 / 1e3) 24 | tv.Sec = int64(nsec / 1e9) 25 | return 26 | } 27 | 28 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 29 | k.Ident = uint32(fd) 30 | k.Filter = uint32(mode) 31 | k.Flags = uint32(flags) 32 | } 33 | 34 | func (iov *Iovec) SetLen(length int) { 35 | iov.Len = uint32(length) 36 | } 37 | 38 | func (msghdr *Msghdr) SetControllen(length int) { 39 | msghdr.Controllen = uint32(length) 40 | } 41 | 42 | func (cmsg *Cmsghdr) SetLen(length int) { 43 | cmsg.Len = uint32(length) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 20 | 21 | func NsecToTimeval(nsec int64) (tv Timeval) { 22 | nsec += 999 // round up to microsecond 23 | tv.Usec = int32(nsec % 1e9 / 1e3) 24 | tv.Sec = int64(nsec / 1e9) 25 | return 26 | } 27 | 28 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 29 | k.Ident = uint32(fd) 30 | k.Filter = int16(mode) 31 | k.Flags = uint16(flags) 32 | } 33 | 34 | func (iov *Iovec) SetLen(length int) { 35 | iov.Len = uint32(length) 36 | } 37 | 38 | func (msghdr *Msghdr) SetControllen(length int) { 39 | msghdr.Controllen = uint32(length) 40 | } 41 | 42 | func (cmsg *Cmsghdr) SetLen(length int) { 43 | cmsg.Len = uint32(length) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = nsec / 1e9 15 | ts.Nsec = nsec % 1e9 16 | return 17 | } 18 | 19 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 20 | 21 | func NsecToTimeval(nsec int64) (tv Timeval) { 22 | nsec += 999 // round up to microsecond 23 | tv.Usec = nsec % 1e9 / 1e3 24 | tv.Sec = nsec / 1e9 25 | return 26 | } 27 | 28 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 29 | k.Ident = uint64(fd) 30 | k.Filter = int16(mode) 31 | k.Flags = uint16(flags) 32 | } 33 | 34 | func (iov *Iovec) SetLen(length int) { 35 | iov.Len = uint64(length) 36 | } 37 | 38 | func (msghdr *Msghdr) SetControllen(length int) { 39 | msghdr.Controllen = uint32(length) 40 | } 41 | 42 | func (cmsg *Cmsghdr) SetLen(length int) { 43 | cmsg.Len = uint32(length) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 10 | 11 | func NsecToTimespec(nsec int64) (ts Timespec) { 12 | ts.Sec = nsec / 1e9 13 | ts.Nsec = nsec % 1e9 14 | return 15 | } 16 | 17 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = nsec % 1e9 / 1e3 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func (iov *Iovec) SetLen(length int) { 27 | iov.Len = uint64(length) 28 | } 29 | 30 | func (cmsg *Cmsghdr) SetLen(length int) { 31 | cmsg.Len = uint32(length) 32 | } 33 | 34 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 35 | // TODO(aram): implement this, see issue 5847. 36 | panic("unimplemented") 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/types_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | /* 8 | Input to cgo -godefs. See also mkerrors.sh and mkall.sh 9 | */ 10 | 11 | // +godefs map struct_in_addr [4]byte /* in_addr */ 12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 13 | 14 | package unix 15 | 16 | /* 17 | #define __DARWIN_UNIX03 0 18 | #define KERNEL 19 | #define _DARWIN_USE_64_BIT_INODE 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | enum { 52 | sizeofPtr = sizeof(void*), 53 | }; 54 | 55 | union sockaddr_all { 56 | struct sockaddr s1; // this one gets used for fields 57 | struct sockaddr_in s2; // these pad it out 58 | struct sockaddr_in6 s3; 59 | struct sockaddr_un s4; 60 | struct sockaddr_dl s5; 61 | }; 62 | 63 | struct sockaddr_any { 64 | struct sockaddr addr; 65 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 66 | }; 67 | 68 | */ 69 | import "C" 70 | 71 | // Machine characteristics; for internal use. 72 | 73 | const ( 74 | sizeofPtr = C.sizeofPtr 75 | sizeofShort = C.sizeof_short 76 | sizeofInt = C.sizeof_int 77 | sizeofLong = C.sizeof_long 78 | sizeofLongLong = C.sizeof_longlong 79 | ) 80 | 81 | // Basic types 82 | 83 | type ( 84 | _C_short C.short 85 | _C_int C.int 86 | _C_long C.long 87 | _C_long_long C.longlong 88 | ) 89 | 90 | // Time 91 | 92 | type Timespec C.struct_timespec 93 | 94 | type Timeval C.struct_timeval 95 | 96 | type Timeval32 C.struct_timeval32 97 | 98 | // Processes 99 | 100 | type Rusage C.struct_rusage 101 | 102 | type Rlimit C.struct_rlimit 103 | 104 | type _Gid_t C.gid_t 105 | 106 | // Files 107 | 108 | type Stat_t C.struct_stat64 109 | 110 | type Statfs_t C.struct_statfs64 111 | 112 | type Flock_t C.struct_flock 113 | 114 | type Fstore_t C.struct_fstore 115 | 116 | type Radvisory_t C.struct_radvisory 117 | 118 | type Fbootstraptransfer_t C.struct_fbootstraptransfer 119 | 120 | type Log2phys_t C.struct_log2phys 121 | 122 | type Fsid C.struct_fsid 123 | 124 | type Dirent C.struct_dirent 125 | 126 | // Sockets 127 | 128 | type RawSockaddrInet4 C.struct_sockaddr_in 129 | 130 | type RawSockaddrInet6 C.struct_sockaddr_in6 131 | 132 | type RawSockaddrUnix C.struct_sockaddr_un 133 | 134 | type RawSockaddrDatalink C.struct_sockaddr_dl 135 | 136 | type RawSockaddr C.struct_sockaddr 137 | 138 | type RawSockaddrAny C.struct_sockaddr_any 139 | 140 | type _Socklen C.socklen_t 141 | 142 | type Linger C.struct_linger 143 | 144 | type Iovec C.struct_iovec 145 | 146 | type IPMreq C.struct_ip_mreq 147 | 148 | type IPv6Mreq C.struct_ipv6_mreq 149 | 150 | type Msghdr C.struct_msghdr 151 | 152 | type Cmsghdr C.struct_cmsghdr 153 | 154 | type Inet4Pktinfo C.struct_in_pktinfo 155 | 156 | type Inet6Pktinfo C.struct_in6_pktinfo 157 | 158 | type IPv6MTUInfo C.struct_ip6_mtuinfo 159 | 160 | type ICMPv6Filter C.struct_icmp6_filter 161 | 162 | const ( 163 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 164 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 165 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 166 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 167 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 168 | SizeofLinger = C.sizeof_struct_linger 169 | SizeofIPMreq = C.sizeof_struct_ip_mreq 170 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 171 | SizeofMsghdr = C.sizeof_struct_msghdr 172 | SizeofCmsghdr = C.sizeof_struct_cmsghdr 173 | SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo 174 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 175 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 176 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 177 | ) 178 | 179 | // Ptrace requests 180 | 181 | const ( 182 | PTRACE_TRACEME = C.PT_TRACE_ME 183 | PTRACE_CONT = C.PT_CONTINUE 184 | PTRACE_KILL = C.PT_KILL 185 | ) 186 | 187 | // Events (kqueue, kevent) 188 | 189 | type Kevent_t C.struct_kevent 190 | 191 | // Select 192 | 193 | type FdSet C.fd_set 194 | 195 | // Routing and interface messages 196 | 197 | const ( 198 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr 199 | SizeofIfData = C.sizeof_struct_if_data 200 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 201 | SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr 202 | SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2 203 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 204 | SizeofRtMetrics = C.sizeof_struct_rt_metrics 205 | ) 206 | 207 | type IfMsghdr C.struct_if_msghdr 208 | 209 | type IfData C.struct_if_data 210 | 211 | type IfaMsghdr C.struct_ifa_msghdr 212 | 213 | type IfmaMsghdr C.struct_ifma_msghdr 214 | 215 | type IfmaMsghdr2 C.struct_ifma_msghdr2 216 | 217 | type RtMsghdr C.struct_rt_msghdr 218 | 219 | type RtMetrics C.struct_rt_metrics 220 | 221 | // Berkeley packet filter 222 | 223 | const ( 224 | SizeofBpfVersion = C.sizeof_struct_bpf_version 225 | SizeofBpfStat = C.sizeof_struct_bpf_stat 226 | SizeofBpfProgram = C.sizeof_struct_bpf_program 227 | SizeofBpfInsn = C.sizeof_struct_bpf_insn 228 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr 229 | ) 230 | 231 | type BpfVersion C.struct_bpf_version 232 | 233 | type BpfStat C.struct_bpf_stat 234 | 235 | type BpfProgram C.struct_bpf_program 236 | 237 | type BpfInsn C.struct_bpf_insn 238 | 239 | type BpfHdr C.struct_bpf_hdr 240 | 241 | // Terminal handling 242 | 243 | type Termios C.struct_termios 244 | 245 | // fchmodat-like syscalls. 246 | 247 | const ( 248 | AT_FDCWD = C.AT_FDCWD 249 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW 250 | ) 251 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/types_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | /* 8 | Input to cgo -godefs. See also mkerrors.sh and mkall.sh 9 | */ 10 | 11 | // +godefs map struct_in_addr [4]byte /* in_addr */ 12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 13 | 14 | package unix 15 | 16 | /* 17 | #define KERNEL 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | enum { 47 | sizeofPtr = sizeof(void*), 48 | }; 49 | 50 | union sockaddr_all { 51 | struct sockaddr s1; // this one gets used for fields 52 | struct sockaddr_in s2; // these pad it out 53 | struct sockaddr_in6 s3; 54 | struct sockaddr_un s4; 55 | struct sockaddr_dl s5; 56 | }; 57 | 58 | struct sockaddr_any { 59 | struct sockaddr addr; 60 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 61 | }; 62 | 63 | */ 64 | import "C" 65 | 66 | // Machine characteristics; for internal use. 67 | 68 | const ( 69 | sizeofPtr = C.sizeofPtr 70 | sizeofShort = C.sizeof_short 71 | sizeofInt = C.sizeof_int 72 | sizeofLong = C.sizeof_long 73 | sizeofLongLong = C.sizeof_longlong 74 | ) 75 | 76 | // Basic types 77 | 78 | type ( 79 | _C_short C.short 80 | _C_int C.int 81 | _C_long C.long 82 | _C_long_long C.longlong 83 | ) 84 | 85 | // Time 86 | 87 | type Timespec C.struct_timespec 88 | 89 | type Timeval C.struct_timeval 90 | 91 | // Processes 92 | 93 | type Rusage C.struct_rusage 94 | 95 | type Rlimit C.struct_rlimit 96 | 97 | type _Gid_t C.gid_t 98 | 99 | // Files 100 | 101 | const ( // Directory mode bits 102 | S_IFMT = C.S_IFMT 103 | S_IFIFO = C.S_IFIFO 104 | S_IFCHR = C.S_IFCHR 105 | S_IFDIR = C.S_IFDIR 106 | S_IFBLK = C.S_IFBLK 107 | S_IFREG = C.S_IFREG 108 | S_IFLNK = C.S_IFLNK 109 | S_IFSOCK = C.S_IFSOCK 110 | S_ISUID = C.S_ISUID 111 | S_ISGID = C.S_ISGID 112 | S_ISVTX = C.S_ISVTX 113 | S_IRUSR = C.S_IRUSR 114 | S_IWUSR = C.S_IWUSR 115 | S_IXUSR = C.S_IXUSR 116 | ) 117 | 118 | type Stat_t C.struct_stat 119 | 120 | type Statfs_t C.struct_statfs 121 | 122 | type Flock_t C.struct_flock 123 | 124 | type Dirent C.struct_dirent 125 | 126 | type Fsid C.struct_fsid 127 | 128 | // Sockets 129 | 130 | type RawSockaddrInet4 C.struct_sockaddr_in 131 | 132 | type RawSockaddrInet6 C.struct_sockaddr_in6 133 | 134 | type RawSockaddrUnix C.struct_sockaddr_un 135 | 136 | type RawSockaddrDatalink C.struct_sockaddr_dl 137 | 138 | type RawSockaddr C.struct_sockaddr 139 | 140 | type RawSockaddrAny C.struct_sockaddr_any 141 | 142 | type _Socklen C.socklen_t 143 | 144 | type Linger C.struct_linger 145 | 146 | type Iovec C.struct_iovec 147 | 148 | type IPMreq C.struct_ip_mreq 149 | 150 | type IPv6Mreq C.struct_ipv6_mreq 151 | 152 | type Msghdr C.struct_msghdr 153 | 154 | type Cmsghdr C.struct_cmsghdr 155 | 156 | type Inet6Pktinfo C.struct_in6_pktinfo 157 | 158 | type IPv6MTUInfo C.struct_ip6_mtuinfo 159 | 160 | type ICMPv6Filter C.struct_icmp6_filter 161 | 162 | const ( 163 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 164 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 165 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 166 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 167 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 168 | SizeofLinger = C.sizeof_struct_linger 169 | SizeofIPMreq = C.sizeof_struct_ip_mreq 170 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 171 | SizeofMsghdr = C.sizeof_struct_msghdr 172 | SizeofCmsghdr = C.sizeof_struct_cmsghdr 173 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 174 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 175 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 176 | ) 177 | 178 | // Ptrace requests 179 | 180 | const ( 181 | PTRACE_TRACEME = C.PT_TRACE_ME 182 | PTRACE_CONT = C.PT_CONTINUE 183 | PTRACE_KILL = C.PT_KILL 184 | ) 185 | 186 | // Events (kqueue, kevent) 187 | 188 | type Kevent_t C.struct_kevent 189 | 190 | // Select 191 | 192 | type FdSet C.fd_set 193 | 194 | // Routing and interface messages 195 | 196 | const ( 197 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr 198 | SizeofIfData = C.sizeof_struct_if_data 199 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 200 | SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr 201 | SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr 202 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 203 | SizeofRtMetrics = C.sizeof_struct_rt_metrics 204 | ) 205 | 206 | type IfMsghdr C.struct_if_msghdr 207 | 208 | type IfData C.struct_if_data 209 | 210 | type IfaMsghdr C.struct_ifa_msghdr 211 | 212 | type IfmaMsghdr C.struct_ifma_msghdr 213 | 214 | type IfAnnounceMsghdr C.struct_if_announcemsghdr 215 | 216 | type RtMsghdr C.struct_rt_msghdr 217 | 218 | type RtMetrics C.struct_rt_metrics 219 | 220 | // Berkeley packet filter 221 | 222 | const ( 223 | SizeofBpfVersion = C.sizeof_struct_bpf_version 224 | SizeofBpfStat = C.sizeof_struct_bpf_stat 225 | SizeofBpfProgram = C.sizeof_struct_bpf_program 226 | SizeofBpfInsn = C.sizeof_struct_bpf_insn 227 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr 228 | ) 229 | 230 | type BpfVersion C.struct_bpf_version 231 | 232 | type BpfStat C.struct_bpf_stat 233 | 234 | type BpfProgram C.struct_bpf_program 235 | 236 | type BpfInsn C.struct_bpf_insn 237 | 238 | type BpfHdr C.struct_bpf_hdr 239 | 240 | // Terminal handling 241 | 242 | type Termios C.struct_termios 243 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/types_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | /* 8 | Input to cgo -godefs. See also mkerrors.sh and mkall.sh 9 | */ 10 | 11 | // +godefs map struct_in_addr [4]byte /* in_addr */ 12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 13 | 14 | package unix 15 | 16 | /* 17 | #define KERNEL 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | enum { 49 | sizeofPtr = sizeof(void*), 50 | }; 51 | 52 | union sockaddr_all { 53 | struct sockaddr s1; // this one gets used for fields 54 | struct sockaddr_in s2; // these pad it out 55 | struct sockaddr_in6 s3; 56 | struct sockaddr_un s4; 57 | struct sockaddr_dl s5; 58 | }; 59 | 60 | struct sockaddr_any { 61 | struct sockaddr addr; 62 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 63 | }; 64 | 65 | */ 66 | import "C" 67 | 68 | // Machine characteristics; for internal use. 69 | 70 | const ( 71 | sizeofPtr = C.sizeofPtr 72 | sizeofShort = C.sizeof_short 73 | sizeofInt = C.sizeof_int 74 | sizeofLong = C.sizeof_long 75 | sizeofLongLong = C.sizeof_longlong 76 | ) 77 | 78 | // Basic types 79 | 80 | type ( 81 | _C_short C.short 82 | _C_int C.int 83 | _C_long C.long 84 | _C_long_long C.longlong 85 | ) 86 | 87 | // Time 88 | 89 | type Timespec C.struct_timespec 90 | 91 | type Timeval C.struct_timeval 92 | 93 | // Processes 94 | 95 | type Rusage C.struct_rusage 96 | 97 | type Rlimit C.struct_rlimit 98 | 99 | type _Gid_t C.gid_t 100 | 101 | // Files 102 | 103 | type Stat_t C.struct_stat 104 | 105 | type Statfs_t C.struct_statfs 106 | 107 | type Flock_t C.struct_flock 108 | 109 | type Dirent C.struct_dirent 110 | 111 | type Fsid C.fsid_t 112 | 113 | // Sockets 114 | 115 | type RawSockaddrInet4 C.struct_sockaddr_in 116 | 117 | type RawSockaddrInet6 C.struct_sockaddr_in6 118 | 119 | type RawSockaddrUnix C.struct_sockaddr_un 120 | 121 | type RawSockaddrDatalink C.struct_sockaddr_dl 122 | 123 | type RawSockaddr C.struct_sockaddr 124 | 125 | type RawSockaddrAny C.struct_sockaddr_any 126 | 127 | type _Socklen C.socklen_t 128 | 129 | type Linger C.struct_linger 130 | 131 | type Iovec C.struct_iovec 132 | 133 | type IPMreq C.struct_ip_mreq 134 | 135 | type IPv6Mreq C.struct_ipv6_mreq 136 | 137 | type Msghdr C.struct_msghdr 138 | 139 | type Cmsghdr C.struct_cmsghdr 140 | 141 | type Inet6Pktinfo C.struct_in6_pktinfo 142 | 143 | type IPv6MTUInfo C.struct_ip6_mtuinfo 144 | 145 | type ICMPv6Filter C.struct_icmp6_filter 146 | 147 | const ( 148 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 149 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 150 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 151 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 152 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 153 | SizeofLinger = C.sizeof_struct_linger 154 | SizeofIPMreq = C.sizeof_struct_ip_mreq 155 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 156 | SizeofMsghdr = C.sizeof_struct_msghdr 157 | SizeofCmsghdr = C.sizeof_struct_cmsghdr 158 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 159 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 160 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 161 | ) 162 | 163 | // Ptrace requests 164 | 165 | const ( 166 | PTRACE_TRACEME = C.PT_TRACE_ME 167 | PTRACE_CONT = C.PT_CONTINUE 168 | PTRACE_KILL = C.PT_KILL 169 | ) 170 | 171 | // Events (kqueue, kevent) 172 | 173 | type Kevent_t C.struct_kevent 174 | 175 | // Select 176 | 177 | type FdSet C.fd_set 178 | 179 | // Routing and interface messages 180 | 181 | const ( 182 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr 183 | SizeofIfData = C.sizeof_struct_if_data 184 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 185 | SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr 186 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 187 | SizeofRtMetrics = C.sizeof_struct_rt_metrics 188 | ) 189 | 190 | type IfMsghdr C.struct_if_msghdr 191 | 192 | type IfData C.struct_if_data 193 | 194 | type IfaMsghdr C.struct_ifa_msghdr 195 | 196 | type IfAnnounceMsghdr C.struct_if_announcemsghdr 197 | 198 | type RtMsghdr C.struct_rt_msghdr 199 | 200 | type RtMetrics C.struct_rt_metrics 201 | 202 | type Mclpool C.struct_mclpool 203 | 204 | // Berkeley packet filter 205 | 206 | const ( 207 | SizeofBpfVersion = C.sizeof_struct_bpf_version 208 | SizeofBpfStat = C.sizeof_struct_bpf_stat 209 | SizeofBpfProgram = C.sizeof_struct_bpf_program 210 | SizeofBpfInsn = C.sizeof_struct_bpf_insn 211 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr 212 | ) 213 | 214 | type BpfVersion C.struct_bpf_version 215 | 216 | type BpfStat C.struct_bpf_stat 217 | 218 | type BpfProgram C.struct_bpf_program 219 | 220 | type BpfInsn C.struct_bpf_insn 221 | 222 | type BpfHdr C.struct_bpf_hdr 223 | 224 | type BpfTimeval C.struct_bpf_timeval 225 | 226 | // Terminal handling 227 | 228 | type Termios C.struct_termios 229 | 230 | // Sysctl 231 | 232 | type Sysctlnode C.struct_sysctlnode 233 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/types_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | /* 8 | Input to cgo -godefs. See also mkerrors.sh and mkall.sh 9 | */ 10 | 11 | // +godefs map struct_in_addr [4]byte /* in_addr */ 12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 13 | 14 | package unix 15 | 16 | /* 17 | #define KERNEL 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | enum { 48 | sizeofPtr = sizeof(void*), 49 | }; 50 | 51 | union sockaddr_all { 52 | struct sockaddr s1; // this one gets used for fields 53 | struct sockaddr_in s2; // these pad it out 54 | struct sockaddr_in6 s3; 55 | struct sockaddr_un s4; 56 | struct sockaddr_dl s5; 57 | }; 58 | 59 | struct sockaddr_any { 60 | struct sockaddr addr; 61 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 62 | }; 63 | 64 | */ 65 | import "C" 66 | 67 | // Machine characteristics; for internal use. 68 | 69 | const ( 70 | sizeofPtr = C.sizeofPtr 71 | sizeofShort = C.sizeof_short 72 | sizeofInt = C.sizeof_int 73 | sizeofLong = C.sizeof_long 74 | sizeofLongLong = C.sizeof_longlong 75 | ) 76 | 77 | // Basic types 78 | 79 | type ( 80 | _C_short C.short 81 | _C_int C.int 82 | _C_long C.long 83 | _C_long_long C.longlong 84 | ) 85 | 86 | // Time 87 | 88 | type Timespec C.struct_timespec 89 | 90 | type Timeval C.struct_timeval 91 | 92 | // Processes 93 | 94 | type Rusage C.struct_rusage 95 | 96 | type Rlimit C.struct_rlimit 97 | 98 | type _Gid_t C.gid_t 99 | 100 | // Files 101 | 102 | const ( // Directory mode bits 103 | S_IFMT = C.S_IFMT 104 | S_IFIFO = C.S_IFIFO 105 | S_IFCHR = C.S_IFCHR 106 | S_IFDIR = C.S_IFDIR 107 | S_IFBLK = C.S_IFBLK 108 | S_IFREG = C.S_IFREG 109 | S_IFLNK = C.S_IFLNK 110 | S_IFSOCK = C.S_IFSOCK 111 | S_ISUID = C.S_ISUID 112 | S_ISGID = C.S_ISGID 113 | S_ISVTX = C.S_ISVTX 114 | S_IRUSR = C.S_IRUSR 115 | S_IWUSR = C.S_IWUSR 116 | S_IXUSR = C.S_IXUSR 117 | ) 118 | 119 | type Stat_t C.struct_stat 120 | 121 | type Statfs_t C.struct_statfs 122 | 123 | type Flock_t C.struct_flock 124 | 125 | type Dirent C.struct_dirent 126 | 127 | type Fsid C.fsid_t 128 | 129 | // Sockets 130 | 131 | type RawSockaddrInet4 C.struct_sockaddr_in 132 | 133 | type RawSockaddrInet6 C.struct_sockaddr_in6 134 | 135 | type RawSockaddrUnix C.struct_sockaddr_un 136 | 137 | type RawSockaddrDatalink C.struct_sockaddr_dl 138 | 139 | type RawSockaddr C.struct_sockaddr 140 | 141 | type RawSockaddrAny C.struct_sockaddr_any 142 | 143 | type _Socklen C.socklen_t 144 | 145 | type Linger C.struct_linger 146 | 147 | type Iovec C.struct_iovec 148 | 149 | type IPMreq C.struct_ip_mreq 150 | 151 | type IPv6Mreq C.struct_ipv6_mreq 152 | 153 | type Msghdr C.struct_msghdr 154 | 155 | type Cmsghdr C.struct_cmsghdr 156 | 157 | type Inet6Pktinfo C.struct_in6_pktinfo 158 | 159 | type IPv6MTUInfo C.struct_ip6_mtuinfo 160 | 161 | type ICMPv6Filter C.struct_icmp6_filter 162 | 163 | const ( 164 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 165 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 166 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 167 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 168 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 169 | SizeofLinger = C.sizeof_struct_linger 170 | SizeofIPMreq = C.sizeof_struct_ip_mreq 171 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 172 | SizeofMsghdr = C.sizeof_struct_msghdr 173 | SizeofCmsghdr = C.sizeof_struct_cmsghdr 174 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 175 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 176 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 177 | ) 178 | 179 | // Ptrace requests 180 | 181 | const ( 182 | PTRACE_TRACEME = C.PT_TRACE_ME 183 | PTRACE_CONT = C.PT_CONTINUE 184 | PTRACE_KILL = C.PT_KILL 185 | ) 186 | 187 | // Events (kqueue, kevent) 188 | 189 | type Kevent_t C.struct_kevent 190 | 191 | // Select 192 | 193 | type FdSet C.fd_set 194 | 195 | // Routing and interface messages 196 | 197 | const ( 198 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr 199 | SizeofIfData = C.sizeof_struct_if_data 200 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 201 | SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr 202 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 203 | SizeofRtMetrics = C.sizeof_struct_rt_metrics 204 | ) 205 | 206 | type IfMsghdr C.struct_if_msghdr 207 | 208 | type IfData C.struct_if_data 209 | 210 | type IfaMsghdr C.struct_ifa_msghdr 211 | 212 | type IfAnnounceMsghdr C.struct_if_announcemsghdr 213 | 214 | type RtMsghdr C.struct_rt_msghdr 215 | 216 | type RtMetrics C.struct_rt_metrics 217 | 218 | type Mclpool C.struct_mclpool 219 | 220 | // Berkeley packet filter 221 | 222 | const ( 223 | SizeofBpfVersion = C.sizeof_struct_bpf_version 224 | SizeofBpfStat = C.sizeof_struct_bpf_stat 225 | SizeofBpfProgram = C.sizeof_struct_bpf_program 226 | SizeofBpfInsn = C.sizeof_struct_bpf_insn 227 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr 228 | ) 229 | 230 | type BpfVersion C.struct_bpf_version 231 | 232 | type BpfStat C.struct_bpf_stat 233 | 234 | type BpfProgram C.struct_bpf_program 235 | 236 | type BpfInsn C.struct_bpf_insn 237 | 238 | type BpfHdr C.struct_bpf_hdr 239 | 240 | type BpfTimeval C.struct_bpf_timeval 241 | 242 | // Terminal handling 243 | 244 | type Termios C.struct_termios 245 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/types_solaris.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | /* 8 | Input to cgo -godefs. See also mkerrors.sh and mkall.sh 9 | */ 10 | 11 | // +godefs map struct_in_addr [4]byte /* in_addr */ 12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 13 | 14 | package unix 15 | 16 | /* 17 | #define KERNEL 18 | // These defines ensure that builds done on newer versions of Solaris are 19 | // backwards-compatible with older versions of Solaris and 20 | // OpenSolaris-based derivatives. 21 | #define __USE_SUNOS_SOCKETS__ // msghdr 22 | #define __USE_LEGACY_PROTOTYPES__ // iovec 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | 55 | enum { 56 | sizeofPtr = sizeof(void*), 57 | }; 58 | 59 | union sockaddr_all { 60 | struct sockaddr s1; // this one gets used for fields 61 | struct sockaddr_in s2; // these pad it out 62 | struct sockaddr_in6 s3; 63 | struct sockaddr_un s4; 64 | struct sockaddr_dl s5; 65 | }; 66 | 67 | struct sockaddr_any { 68 | struct sockaddr addr; 69 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 70 | }; 71 | 72 | */ 73 | import "C" 74 | 75 | // Machine characteristics; for internal use. 76 | 77 | const ( 78 | sizeofPtr = C.sizeofPtr 79 | sizeofShort = C.sizeof_short 80 | sizeofInt = C.sizeof_int 81 | sizeofLong = C.sizeof_long 82 | sizeofLongLong = C.sizeof_longlong 83 | PathMax = C.PATH_MAX 84 | ) 85 | 86 | // Basic types 87 | 88 | type ( 89 | _C_short C.short 90 | _C_int C.int 91 | _C_long C.long 92 | _C_long_long C.longlong 93 | ) 94 | 95 | // Time 96 | 97 | type Timespec C.struct_timespec 98 | 99 | type Timeval C.struct_timeval 100 | 101 | type Timeval32 C.struct_timeval32 102 | 103 | type Tms C.struct_tms 104 | 105 | type Utimbuf C.struct_utimbuf 106 | 107 | // Processes 108 | 109 | type Rusage C.struct_rusage 110 | 111 | type Rlimit C.struct_rlimit 112 | 113 | type _Gid_t C.gid_t 114 | 115 | // Files 116 | 117 | const ( // Directory mode bits 118 | S_IFMT = C.S_IFMT 119 | S_IFIFO = C.S_IFIFO 120 | S_IFCHR = C.S_IFCHR 121 | S_IFDIR = C.S_IFDIR 122 | S_IFBLK = C.S_IFBLK 123 | S_IFREG = C.S_IFREG 124 | S_IFLNK = C.S_IFLNK 125 | S_IFSOCK = C.S_IFSOCK 126 | S_ISUID = C.S_ISUID 127 | S_ISGID = C.S_ISGID 128 | S_ISVTX = C.S_ISVTX 129 | S_IRUSR = C.S_IRUSR 130 | S_IWUSR = C.S_IWUSR 131 | S_IXUSR = C.S_IXUSR 132 | ) 133 | 134 | type Stat_t C.struct_stat 135 | 136 | type Flock_t C.struct_flock 137 | 138 | type Dirent C.struct_dirent 139 | 140 | // Sockets 141 | 142 | type RawSockaddrInet4 C.struct_sockaddr_in 143 | 144 | type RawSockaddrInet6 C.struct_sockaddr_in6 145 | 146 | type RawSockaddrUnix C.struct_sockaddr_un 147 | 148 | type RawSockaddrDatalink C.struct_sockaddr_dl 149 | 150 | type RawSockaddr C.struct_sockaddr 151 | 152 | type RawSockaddrAny C.struct_sockaddr_any 153 | 154 | type _Socklen C.socklen_t 155 | 156 | type Linger C.struct_linger 157 | 158 | type Iovec C.struct_iovec 159 | 160 | type IPMreq C.struct_ip_mreq 161 | 162 | type IPv6Mreq C.struct_ipv6_mreq 163 | 164 | type Msghdr C.struct_msghdr 165 | 166 | type Cmsghdr C.struct_cmsghdr 167 | 168 | type Inet6Pktinfo C.struct_in6_pktinfo 169 | 170 | type IPv6MTUInfo C.struct_ip6_mtuinfo 171 | 172 | type ICMPv6Filter C.struct_icmp6_filter 173 | 174 | const ( 175 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 176 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 177 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 178 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 179 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 180 | SizeofLinger = C.sizeof_struct_linger 181 | SizeofIPMreq = C.sizeof_struct_ip_mreq 182 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 183 | SizeofMsghdr = C.sizeof_struct_msghdr 184 | SizeofCmsghdr = C.sizeof_struct_cmsghdr 185 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 186 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 187 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 188 | ) 189 | 190 | // Select 191 | 192 | type FdSet C.fd_set 193 | 194 | // Misc 195 | 196 | type Utsname C.struct_utsname 197 | 198 | type Ustat_t C.struct_ustat 199 | 200 | const ( 201 | AT_FDCWD = C.AT_FDCWD 202 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW 203 | AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW 204 | AT_REMOVEDIR = C.AT_REMOVEDIR 205 | AT_EACCESS = C.AT_EACCESS 206 | ) 207 | 208 | // Routing and interface messages 209 | 210 | const ( 211 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr 212 | SizeofIfData = C.sizeof_struct_if_data 213 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 214 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 215 | SizeofRtMetrics = C.sizeof_struct_rt_metrics 216 | ) 217 | 218 | type IfMsghdr C.struct_if_msghdr 219 | 220 | type IfData C.struct_if_data 221 | 222 | type IfaMsghdr C.struct_ifa_msghdr 223 | 224 | type RtMsghdr C.struct_rt_msghdr 225 | 226 | type RtMetrics C.struct_rt_metrics 227 | 228 | // Berkeley packet filter 229 | 230 | const ( 231 | SizeofBpfVersion = C.sizeof_struct_bpf_version 232 | SizeofBpfStat = C.sizeof_struct_bpf_stat 233 | SizeofBpfProgram = C.sizeof_struct_bpf_program 234 | SizeofBpfInsn = C.sizeof_struct_bpf_insn 235 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr 236 | ) 237 | 238 | type BpfVersion C.struct_bpf_version 239 | 240 | type BpfStat C.struct_bpf_stat 241 | 242 | type BpfProgram C.struct_bpf_program 243 | 244 | type BpfInsn C.struct_bpf_insn 245 | 246 | type BpfTimeval C.struct_bpf_timeval 247 | 248 | type BpfHdr C.struct_bpf_hdr 249 | 250 | // sysconf information 251 | 252 | const _SC_PAGESIZE = C._SC_PAGESIZE 253 | 254 | // Terminal handling 255 | 256 | type Termios C.struct_termios 257 | 258 | type Termio C.struct_termio 259 | 260 | type Winsize C.struct_winsize 261 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_netbsd.go 3 | 4 | // +build 386,netbsd 5 | 6 | package unix 7 | 8 | const ( 9 | sizeofPtr = 0x4 10 | sizeofShort = 0x2 11 | sizeofInt = 0x4 12 | sizeofLong = 0x4 13 | sizeofLongLong = 0x8 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type Timespec struct { 24 | Sec int64 25 | Nsec int32 26 | } 27 | 28 | type Timeval struct { 29 | Sec int64 30 | Usec int32 31 | } 32 | 33 | type Rusage struct { 34 | Utime Timeval 35 | Stime Timeval 36 | Maxrss int32 37 | Ixrss int32 38 | Idrss int32 39 | Isrss int32 40 | Minflt int32 41 | Majflt int32 42 | Nswap int32 43 | Inblock int32 44 | Oublock int32 45 | Msgsnd int32 46 | Msgrcv int32 47 | Nsignals int32 48 | Nvcsw int32 49 | Nivcsw int32 50 | } 51 | 52 | type Rlimit struct { 53 | Cur uint64 54 | Max uint64 55 | } 56 | 57 | type _Gid_t uint32 58 | 59 | type Stat_t struct { 60 | Dev uint64 61 | Mode uint32 62 | Ino uint64 63 | Nlink uint32 64 | Uid uint32 65 | Gid uint32 66 | Rdev uint64 67 | Atimespec Timespec 68 | Mtimespec Timespec 69 | Ctimespec Timespec 70 | Birthtimespec Timespec 71 | Size int64 72 | Blocks int64 73 | Blksize uint32 74 | Flags uint32 75 | Gen uint32 76 | Spare [2]uint32 77 | } 78 | 79 | type Statfs_t [0]byte 80 | 81 | type Flock_t struct { 82 | Start int64 83 | Len int64 84 | Pid int32 85 | Type int16 86 | Whence int16 87 | } 88 | 89 | type Dirent struct { 90 | Fileno uint64 91 | Reclen uint16 92 | Namlen uint16 93 | Type uint8 94 | Name [512]int8 95 | Pad_cgo_0 [3]byte 96 | } 97 | 98 | type Fsid struct { 99 | X__fsid_val [2]int32 100 | } 101 | 102 | type RawSockaddrInet4 struct { 103 | Len uint8 104 | Family uint8 105 | Port uint16 106 | Addr [4]byte /* in_addr */ 107 | Zero [8]int8 108 | } 109 | 110 | type RawSockaddrInet6 struct { 111 | Len uint8 112 | Family uint8 113 | Port uint16 114 | Flowinfo uint32 115 | Addr [16]byte /* in6_addr */ 116 | Scope_id uint32 117 | } 118 | 119 | type RawSockaddrUnix struct { 120 | Len uint8 121 | Family uint8 122 | Path [104]int8 123 | } 124 | 125 | type RawSockaddrDatalink struct { 126 | Len uint8 127 | Family uint8 128 | Index uint16 129 | Type uint8 130 | Nlen uint8 131 | Alen uint8 132 | Slen uint8 133 | Data [12]int8 134 | } 135 | 136 | type RawSockaddr struct { 137 | Len uint8 138 | Family uint8 139 | Data [14]int8 140 | } 141 | 142 | type RawSockaddrAny struct { 143 | Addr RawSockaddr 144 | Pad [92]int8 145 | } 146 | 147 | type _Socklen uint32 148 | 149 | type Linger struct { 150 | Onoff int32 151 | Linger int32 152 | } 153 | 154 | type Iovec struct { 155 | Base *byte 156 | Len uint32 157 | } 158 | 159 | type IPMreq struct { 160 | Multiaddr [4]byte /* in_addr */ 161 | Interface [4]byte /* in_addr */ 162 | } 163 | 164 | type IPv6Mreq struct { 165 | Multiaddr [16]byte /* in6_addr */ 166 | Interface uint32 167 | } 168 | 169 | type Msghdr struct { 170 | Name *byte 171 | Namelen uint32 172 | Iov *Iovec 173 | Iovlen int32 174 | Control *byte 175 | Controllen uint32 176 | Flags int32 177 | } 178 | 179 | type Cmsghdr struct { 180 | Len uint32 181 | Level int32 182 | Type int32 183 | } 184 | 185 | type Inet6Pktinfo struct { 186 | Addr [16]byte /* in6_addr */ 187 | Ifindex uint32 188 | } 189 | 190 | type IPv6MTUInfo struct { 191 | Addr RawSockaddrInet6 192 | Mtu uint32 193 | } 194 | 195 | type ICMPv6Filter struct { 196 | Filt [8]uint32 197 | } 198 | 199 | const ( 200 | SizeofSockaddrInet4 = 0x10 201 | SizeofSockaddrInet6 = 0x1c 202 | SizeofSockaddrAny = 0x6c 203 | SizeofSockaddrUnix = 0x6a 204 | SizeofSockaddrDatalink = 0x14 205 | SizeofLinger = 0x8 206 | SizeofIPMreq = 0x8 207 | SizeofIPv6Mreq = 0x14 208 | SizeofMsghdr = 0x1c 209 | SizeofCmsghdr = 0xc 210 | SizeofInet6Pktinfo = 0x14 211 | SizeofIPv6MTUInfo = 0x20 212 | SizeofICMPv6Filter = 0x20 213 | ) 214 | 215 | const ( 216 | PTRACE_TRACEME = 0x0 217 | PTRACE_CONT = 0x7 218 | PTRACE_KILL = 0x8 219 | ) 220 | 221 | type Kevent_t struct { 222 | Ident uint32 223 | Filter uint32 224 | Flags uint32 225 | Fflags uint32 226 | Data int64 227 | Udata int32 228 | } 229 | 230 | type FdSet struct { 231 | Bits [8]uint32 232 | } 233 | 234 | const ( 235 | SizeofIfMsghdr = 0x98 236 | SizeofIfData = 0x84 237 | SizeofIfaMsghdr = 0x18 238 | SizeofIfAnnounceMsghdr = 0x18 239 | SizeofRtMsghdr = 0x78 240 | SizeofRtMetrics = 0x50 241 | ) 242 | 243 | type IfMsghdr struct { 244 | Msglen uint16 245 | Version uint8 246 | Type uint8 247 | Addrs int32 248 | Flags int32 249 | Index uint16 250 | Pad_cgo_0 [2]byte 251 | Data IfData 252 | Pad_cgo_1 [4]byte 253 | } 254 | 255 | type IfData struct { 256 | Type uint8 257 | Addrlen uint8 258 | Hdrlen uint8 259 | Pad_cgo_0 [1]byte 260 | Link_state int32 261 | Mtu uint64 262 | Metric uint64 263 | Baudrate uint64 264 | Ipackets uint64 265 | Ierrors uint64 266 | Opackets uint64 267 | Oerrors uint64 268 | Collisions uint64 269 | Ibytes uint64 270 | Obytes uint64 271 | Imcasts uint64 272 | Omcasts uint64 273 | Iqdrops uint64 274 | Noproto uint64 275 | Lastchange Timespec 276 | } 277 | 278 | type IfaMsghdr struct { 279 | Msglen uint16 280 | Version uint8 281 | Type uint8 282 | Addrs int32 283 | Flags int32 284 | Metric int32 285 | Index uint16 286 | Pad_cgo_0 [6]byte 287 | } 288 | 289 | type IfAnnounceMsghdr struct { 290 | Msglen uint16 291 | Version uint8 292 | Type uint8 293 | Index uint16 294 | Name [16]int8 295 | What uint16 296 | } 297 | 298 | type RtMsghdr struct { 299 | Msglen uint16 300 | Version uint8 301 | Type uint8 302 | Index uint16 303 | Pad_cgo_0 [2]byte 304 | Flags int32 305 | Addrs int32 306 | Pid int32 307 | Seq int32 308 | Errno int32 309 | Use int32 310 | Inits int32 311 | Pad_cgo_1 [4]byte 312 | Rmx RtMetrics 313 | } 314 | 315 | type RtMetrics struct { 316 | Locks uint64 317 | Mtu uint64 318 | Hopcount uint64 319 | Recvpipe uint64 320 | Sendpipe uint64 321 | Ssthresh uint64 322 | Rtt uint64 323 | Rttvar uint64 324 | Expire int64 325 | Pksent int64 326 | } 327 | 328 | type Mclpool [0]byte 329 | 330 | const ( 331 | SizeofBpfVersion = 0x4 332 | SizeofBpfStat = 0x80 333 | SizeofBpfProgram = 0x8 334 | SizeofBpfInsn = 0x8 335 | SizeofBpfHdr = 0x14 336 | ) 337 | 338 | type BpfVersion struct { 339 | Major uint16 340 | Minor uint16 341 | } 342 | 343 | type BpfStat struct { 344 | Recv uint64 345 | Drop uint64 346 | Capt uint64 347 | Padding [13]uint64 348 | } 349 | 350 | type BpfProgram struct { 351 | Len uint32 352 | Insns *BpfInsn 353 | } 354 | 355 | type BpfInsn struct { 356 | Code uint16 357 | Jt uint8 358 | Jf uint8 359 | K uint32 360 | } 361 | 362 | type BpfHdr struct { 363 | Tstamp BpfTimeval 364 | Caplen uint32 365 | Datalen uint32 366 | Hdrlen uint16 367 | Pad_cgo_0 [2]byte 368 | } 369 | 370 | type BpfTimeval struct { 371 | Sec int32 372 | Usec int32 373 | } 374 | 375 | type Termios struct { 376 | Iflag uint32 377 | Oflag uint32 378 | Cflag uint32 379 | Lflag uint32 380 | Cc [20]uint8 381 | Ispeed int32 382 | Ospeed int32 383 | } 384 | 385 | type Sysctlnode struct { 386 | Flags uint32 387 | Num int32 388 | Name [32]int8 389 | Ver uint32 390 | X__rsvd uint32 391 | Un [16]byte 392 | X_sysctl_size [8]byte 393 | X_sysctl_func [8]byte 394 | X_sysctl_parent [8]byte 395 | X_sysctl_desc [8]byte 396 | } 397 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_netbsd.go 3 | 4 | // +build arm,netbsd 5 | 6 | package unix 7 | 8 | const ( 9 | sizeofPtr = 0x4 10 | sizeofShort = 0x2 11 | sizeofInt = 0x4 12 | sizeofLong = 0x4 13 | sizeofLongLong = 0x8 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type Timespec struct { 24 | Sec int64 25 | Nsec int32 26 | Pad_cgo_0 [4]byte 27 | } 28 | 29 | type Timeval struct { 30 | Sec int64 31 | Usec int32 32 | Pad_cgo_0 [4]byte 33 | } 34 | 35 | type Rusage struct { 36 | Utime Timeval 37 | Stime Timeval 38 | Maxrss int32 39 | Ixrss int32 40 | Idrss int32 41 | Isrss int32 42 | Minflt int32 43 | Majflt int32 44 | Nswap int32 45 | Inblock int32 46 | Oublock int32 47 | Msgsnd int32 48 | Msgrcv int32 49 | Nsignals int32 50 | Nvcsw int32 51 | Nivcsw int32 52 | } 53 | 54 | type Rlimit struct { 55 | Cur uint64 56 | Max uint64 57 | } 58 | 59 | type _Gid_t uint32 60 | 61 | type Stat_t struct { 62 | Dev uint64 63 | Mode uint32 64 | Pad_cgo_0 [4]byte 65 | Ino uint64 66 | Nlink uint32 67 | Uid uint32 68 | Gid uint32 69 | Pad_cgo_1 [4]byte 70 | Rdev uint64 71 | Atimespec Timespec 72 | Mtimespec Timespec 73 | Ctimespec Timespec 74 | Birthtimespec Timespec 75 | Size int64 76 | Blocks int64 77 | Blksize uint32 78 | Flags uint32 79 | Gen uint32 80 | Spare [2]uint32 81 | Pad_cgo_2 [4]byte 82 | } 83 | 84 | type Statfs_t [0]byte 85 | 86 | type Flock_t struct { 87 | Start int64 88 | Len int64 89 | Pid int32 90 | Type int16 91 | Whence int16 92 | } 93 | 94 | type Dirent struct { 95 | Fileno uint64 96 | Reclen uint16 97 | Namlen uint16 98 | Type uint8 99 | Name [512]int8 100 | Pad_cgo_0 [3]byte 101 | } 102 | 103 | type Fsid struct { 104 | X__fsid_val [2]int32 105 | } 106 | 107 | type RawSockaddrInet4 struct { 108 | Len uint8 109 | Family uint8 110 | Port uint16 111 | Addr [4]byte /* in_addr */ 112 | Zero [8]int8 113 | } 114 | 115 | type RawSockaddrInet6 struct { 116 | Len uint8 117 | Family uint8 118 | Port uint16 119 | Flowinfo uint32 120 | Addr [16]byte /* in6_addr */ 121 | Scope_id uint32 122 | } 123 | 124 | type RawSockaddrUnix struct { 125 | Len uint8 126 | Family uint8 127 | Path [104]int8 128 | } 129 | 130 | type RawSockaddrDatalink struct { 131 | Len uint8 132 | Family uint8 133 | Index uint16 134 | Type uint8 135 | Nlen uint8 136 | Alen uint8 137 | Slen uint8 138 | Data [12]int8 139 | } 140 | 141 | type RawSockaddr struct { 142 | Len uint8 143 | Family uint8 144 | Data [14]int8 145 | } 146 | 147 | type RawSockaddrAny struct { 148 | Addr RawSockaddr 149 | Pad [92]int8 150 | } 151 | 152 | type _Socklen uint32 153 | 154 | type Linger struct { 155 | Onoff int32 156 | Linger int32 157 | } 158 | 159 | type Iovec struct { 160 | Base *byte 161 | Len uint32 162 | } 163 | 164 | type IPMreq struct { 165 | Multiaddr [4]byte /* in_addr */ 166 | Interface [4]byte /* in_addr */ 167 | } 168 | 169 | type IPv6Mreq struct { 170 | Multiaddr [16]byte /* in6_addr */ 171 | Interface uint32 172 | } 173 | 174 | type Msghdr struct { 175 | Name *byte 176 | Namelen uint32 177 | Iov *Iovec 178 | Iovlen int32 179 | Control *byte 180 | Controllen uint32 181 | Flags int32 182 | } 183 | 184 | type Cmsghdr struct { 185 | Len uint32 186 | Level int32 187 | Type int32 188 | } 189 | 190 | type Inet6Pktinfo struct { 191 | Addr [16]byte /* in6_addr */ 192 | Ifindex uint32 193 | } 194 | 195 | type IPv6MTUInfo struct { 196 | Addr RawSockaddrInet6 197 | Mtu uint32 198 | } 199 | 200 | type ICMPv6Filter struct { 201 | Filt [8]uint32 202 | } 203 | 204 | const ( 205 | SizeofSockaddrInet4 = 0x10 206 | SizeofSockaddrInet6 = 0x1c 207 | SizeofSockaddrAny = 0x6c 208 | SizeofSockaddrUnix = 0x6a 209 | SizeofSockaddrDatalink = 0x14 210 | SizeofLinger = 0x8 211 | SizeofIPMreq = 0x8 212 | SizeofIPv6Mreq = 0x14 213 | SizeofMsghdr = 0x1c 214 | SizeofCmsghdr = 0xc 215 | SizeofInet6Pktinfo = 0x14 216 | SizeofIPv6MTUInfo = 0x20 217 | SizeofICMPv6Filter = 0x20 218 | ) 219 | 220 | const ( 221 | PTRACE_TRACEME = 0x0 222 | PTRACE_CONT = 0x7 223 | PTRACE_KILL = 0x8 224 | ) 225 | 226 | type Kevent_t struct { 227 | Ident uint32 228 | Filter uint32 229 | Flags uint32 230 | Fflags uint32 231 | Data int64 232 | Udata int32 233 | Pad_cgo_0 [4]byte 234 | } 235 | 236 | type FdSet struct { 237 | Bits [8]uint32 238 | } 239 | 240 | const ( 241 | SizeofIfMsghdr = 0x98 242 | SizeofIfData = 0x88 243 | SizeofIfaMsghdr = 0x18 244 | SizeofIfAnnounceMsghdr = 0x18 245 | SizeofRtMsghdr = 0x78 246 | SizeofRtMetrics = 0x50 247 | ) 248 | 249 | type IfMsghdr struct { 250 | Msglen uint16 251 | Version uint8 252 | Type uint8 253 | Addrs int32 254 | Flags int32 255 | Index uint16 256 | Pad_cgo_0 [2]byte 257 | Data IfData 258 | } 259 | 260 | type IfData struct { 261 | Type uint8 262 | Addrlen uint8 263 | Hdrlen uint8 264 | Pad_cgo_0 [1]byte 265 | Link_state int32 266 | Mtu uint64 267 | Metric uint64 268 | Baudrate uint64 269 | Ipackets uint64 270 | Ierrors uint64 271 | Opackets uint64 272 | Oerrors uint64 273 | Collisions uint64 274 | Ibytes uint64 275 | Obytes uint64 276 | Imcasts uint64 277 | Omcasts uint64 278 | Iqdrops uint64 279 | Noproto uint64 280 | Lastchange Timespec 281 | } 282 | 283 | type IfaMsghdr struct { 284 | Msglen uint16 285 | Version uint8 286 | Type uint8 287 | Addrs int32 288 | Flags int32 289 | Metric int32 290 | Index uint16 291 | Pad_cgo_0 [6]byte 292 | } 293 | 294 | type IfAnnounceMsghdr struct { 295 | Msglen uint16 296 | Version uint8 297 | Type uint8 298 | Index uint16 299 | Name [16]int8 300 | What uint16 301 | } 302 | 303 | type RtMsghdr struct { 304 | Msglen uint16 305 | Version uint8 306 | Type uint8 307 | Index uint16 308 | Pad_cgo_0 [2]byte 309 | Flags int32 310 | Addrs int32 311 | Pid int32 312 | Seq int32 313 | Errno int32 314 | Use int32 315 | Inits int32 316 | Pad_cgo_1 [4]byte 317 | Rmx RtMetrics 318 | } 319 | 320 | type RtMetrics struct { 321 | Locks uint64 322 | Mtu uint64 323 | Hopcount uint64 324 | Recvpipe uint64 325 | Sendpipe uint64 326 | Ssthresh uint64 327 | Rtt uint64 328 | Rttvar uint64 329 | Expire int64 330 | Pksent int64 331 | } 332 | 333 | type Mclpool [0]byte 334 | 335 | const ( 336 | SizeofBpfVersion = 0x4 337 | SizeofBpfStat = 0x80 338 | SizeofBpfProgram = 0x8 339 | SizeofBpfInsn = 0x8 340 | SizeofBpfHdr = 0x14 341 | ) 342 | 343 | type BpfVersion struct { 344 | Major uint16 345 | Minor uint16 346 | } 347 | 348 | type BpfStat struct { 349 | Recv uint64 350 | Drop uint64 351 | Capt uint64 352 | Padding [13]uint64 353 | } 354 | 355 | type BpfProgram struct { 356 | Len uint32 357 | Insns *BpfInsn 358 | } 359 | 360 | type BpfInsn struct { 361 | Code uint16 362 | Jt uint8 363 | Jf uint8 364 | K uint32 365 | } 366 | 367 | type BpfHdr struct { 368 | Tstamp BpfTimeval 369 | Caplen uint32 370 | Datalen uint32 371 | Hdrlen uint16 372 | Pad_cgo_0 [2]byte 373 | } 374 | 375 | type BpfTimeval struct { 376 | Sec int32 377 | Usec int32 378 | } 379 | 380 | type Termios struct { 381 | Iflag uint32 382 | Oflag uint32 383 | Cflag uint32 384 | Lflag uint32 385 | Cc [20]uint8 386 | Ispeed int32 387 | Ospeed int32 388 | } 389 | 390 | type Sysctlnode struct { 391 | Flags uint32 392 | Num int32 393 | Name [32]int8 394 | Ver uint32 395 | X__rsvd uint32 396 | Un [16]byte 397 | X_sysctl_size [8]byte 398 | X_sysctl_func [8]byte 399 | X_sysctl_parent [8]byte 400 | X_sysctl_desc [8]byte 401 | } 402 | -------------------------------------------------------------------------------- /vendor/vendor.json: -------------------------------------------------------------------------------- 1 | { 2 | "comment": "", 3 | "ignore": "test", 4 | "package": [ 5 | { 6 | "path": "github.com/boltdb/bolt", 7 | "revision": "ee4a0888a9abe7eefe5a0992ca4cb06864839873", 8 | "revisionTime": "2016-01-19T17:55:44-07:00" 9 | }, 10 | { 11 | "path": "github.com/gorilla/context", 12 | "revision": "1c83b3eabd45b6d76072b66b746c20815fb2872d", 13 | "revisionTime": "2015-08-19T22:12:45-07:00" 14 | }, 15 | { 16 | "path": "github.com/gorilla/mux", 17 | "revision": "26a6070f849969ba72b72256e9f14cf519751690", 18 | "revisionTime": "2015-12-31T08:19:08-08:00" 19 | }, 20 | { 21 | "path": "golang.org/x/crypto/bcrypt", 22 | "revision": "1f22c0103821b9390939b6776727195525381532", 23 | "revisionTime": "2016-01-26T09:50:25-08:00" 24 | }, 25 | { 26 | "path": "golang.org/x/crypto/blowfish", 27 | "revision": "1f22c0103821b9390939b6776727195525381532", 28 | "revisionTime": "2016-01-26T09:50:25-08:00" 29 | }, 30 | { 31 | "path": "golang.org/x/sys/unix", 32 | "revision": "eb2c74142fd19a79b3f237334c7384d5167b1b46", 33 | "revisionTime": "2016-01-26T17:36:05-08:00" 34 | } 35 | ] 36 | } 37 | --------------------------------------------------------------------------------